qitianwu / NodeFormer

The official implementation of NeurIPS22 spotlight paper "NodeFormer: A Scalable Graph Structure Learning Transformer for Node Classification"
286 stars 27 forks source link

'NoneType' object has no attribute 'origin' #12

Closed zhengyuting45454455 closed 1 year ago

zhengyuting45454455 commented 1 year ago

When I run the main.py and I have the dataset named 20news,but the code can't run. The traceback is that: python main.py --dataset 20news --metric acc --rand_split --method nodeformer --lr 0.001 --weight_decay 5e-3 --num_layers 2 --hidden_channels 64 --num_heads 4 --rb_order 2 --rb_trans sigmoid --lamda 1.0 --M 30 --K 10 --use_bn --use_residual --use_gumbel --run 5 --epochs 200 --device 1 Traceback (most recent call last): File "main.py", line 8, in from torch_geometric.utils import to_undirected, remove_self_loops, add_self_loops File "/home/zhengyt/anaconda3/envs/Node/lib/python3.8/site-packages/torch_geometric/init.py", line 5, in import torch_geometric.data File "/home/zhengyt/anaconda3/envs/Node/lib/python3.8/site-packages/torch_geometric/data/init.py", line 1, in from .data import Data File "/home/zhengyt/anaconda3/envs/Node/lib/python3.8/site-packages/torch_geometric/data/data.py", line 8, in from torch_sparse import coalesce, SparseTensor File "/home/zhengyt/anaconda3/envs/Node/lib/python3.8/site-packages/torch_sparse/init.py", line 14, in torch.ops.load_library(importlib.machinery.PathFinder().find_spec( AttributeError: 'NoneType' object has no attribute 'origin'

qitianwu commented 1 year ago

It seems this is caused by the inconsistent versions of pyg and torch_sparse. You can follow the version indicated by requirement.txt and installs the correct version