dgl icon indicating copy to clipboard operation
dgl copied to clipboard

[Bug] [Example] Transformer example is dated and does not work with latest networkx

Open chang-l opened this issue 1 year ago • 3 comments

🐛 Bug

The following example is outdated and does not work with later networkx pkg (networkx==3.3): https://github.com/dmlc/dgl/tree/master/examples/pytorch/transformer

To Reproduce

Steps to reproduce the behavior:

  1. python3 translation_train.py --gpus 0 --N 2 --dataset sort

Stack trace:

Traceback (most recent call last):
  File "/workspace/examples/transformer/translation_train.py", line 9, in <module>
    from modules import *
  File "/opt/dgl/dgl-source/examples/pytorch/transformer/modules/__init__.py", line 1, in <module>
    from .models import *
  File "/opt/dgl/dgl-source/examples/pytorch/transformer/modules/models.py", line 4, in <module>
    from .viz import *
  File "/opt/dgl/dgl-source/examples/pytorch/transformer/modules/viz.py", line 176, in <module>
    from networkx.utils import is_string_like
ImportError: cannot import name 'is_string_like' from 'networkx.utils' (/usr/local/lib/python3.10/dist-packages/networkx/utils/__init__.py)

Environment

  • DGL Version (e.g., 1.0): 2.2
  • Backend Library & Version (e.g., PyTorch 0.4.1, MXNet/Gluon 1.3): PyTorch 2.3
  • OS (e.g., Linux):
  • How you installed DGL (conda, pip, source): source

Additional context

I noticed in the README it says: This example is out-dated, please refer to [BP-Transformer](http://github.com/yzh119/bpt) for efficient (Sparse) Transformer implementation in DGL. However the BP-Transformer repo is also archived... I wonder if we can replace this example to BP-T (or merge them) for regular maintenance? cc. @frozenbugs @TristonC

chang-l avatar May 13 '24 17:05 chang-l

This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you

github-actions[bot] avatar Jun 13 '24 01:06 github-actions[bot]

Hi Zihao, can you clarify your plan for this example? Can we just remove the deprecated example?

frozenbugs avatar Jun 17 '24 09:06 frozenbugs

I have no bandwidth to work on this and please just remove, thank you.

yzh119 avatar Jun 20 '24 09:06 yzh119

This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you

github-actions[bot] avatar Jul 21 '24 01:07 github-actions[bot]