graphdeeplearning / graphtransformer

Graph Transformer Architecture. Source code for "A Generalization of Transformer Networks to Graphs", DLG-AAAI'21.
https://arxiv.org/abs/2012.09699
MIT License
872 stars 134 forks source link

AttributeError: Can't get attribute 'DGLHeteroGraph' on <module 'dgl.heterograph' > #26

Closed RodyCoco closed 1 year ago

RodyCoco commented 1 year ago

Hi, I try to run the example code "main_SBMs_node_classification.py" by the following command:

python main_SBMs_node_classification.py --gpu_id 0 --config 'configs/SBMs_GraphTransformer_CLUSTER_500k_full_graph_BN.json'

But it comes with the following error: AttributeError: Can't get attribute 'DGLHeteroGraph' on <module 'dgl.heterograph' from '/home/rody/.local/share/virtualenvs/rody-V7qEFACp/lib/python3.6/site-packages/dgl/heterograph.py'>

How can I fix this bug, thanks!

RodyCoco commented 1 year ago

I fix it by remove dgl and install dgl(cuda version) because I run with gpu.

fei-wang-1314 commented 1 year ago

https://blog.csdn.net/weixin_39554819/article/details/128569482

该方法可以用,已测。

BodongDu commented 10 months ago

I remove dgl and installed dgl 1.1.2+cu118 dglgo 0.0.2(cuda version==12.2), but it still comes with the following errors: cuda available with GPU: NVIDIA GeForce RTX 3090 [I] Loading dataset SBM_CLUSTER... Traceback (most recent call last): File "/home/zbh/whd/benchmarking-gnns-master/main_SBMs_node_classification.py", line 428, in main()
File "/home/zbh/whd/benchmarking-gnns-master/main_SBMs_node_classification.py", line 318, in main dataset = LoadData(DATASET_NAME) File "/home/zbh/whd/benchmarking-gnns-master/data/data.py", line 38, in LoadData return SBMsDataset(DATASET_NAME) File "/home/zbh/whd/benchmarking-gnns-master/data/SBMs.py", line 160, in init f = pickle.load(f) AttributeError: Can't get attribute 'DGLHeteroGraph' on <module 'dgl.heterograph' from '/home/zbh/.conda/envs/dgl/lib/python3.9/site-packages/dgl/heterograph.py'>. How can I fix this bug, thx!

BodongDu commented 10 months ago

Maybe the .pkl file version is not compatible with the newest version of dgl??