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

ValueError: Both 'src' and 'index' must be on the same device (got 'cpu' and 'cuda:1') #13

Closed xx-m closed 9 months ago

xx-m commented 9 months ago

This bug occurs when I do node classification experiments on the dataset ogbn-proteins.

Traceback (most recent call last): File "/NodeFormer/main-batch.py", line 138, in edge_indexi, = subgraph(idx_i, adjs[0], num_nodes=n, relabel_nodes=True) File "/python3.10/site-packages/torch_geometric/utils/subgraph.py", line 104, in subgraph edgeindex, = map_index( File "/python3.10/site-packages/torch_geometric/utils/map.py", line 63, in map_index raise ValueError(f"Both 'src' and 'index' must be on the same device "

qitianwu commented 9 months ago

Seems you did not use the correct version of the packages or datasets