[Bug] [Example] Transformer example is dated and does not work with latest networkx
🐛 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:
- 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
This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you
Hi Zihao, can you clarify your plan for this example? Can we just remove the deprecated example?
I have no bandwidth to work on this and please just remove, thank you.
This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you