pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.15k stars 3.64k forks source link

ImportError of import torch_scatter.scatter_cpu #4902

Open jiaruHithub opened 2 years ago

jiaruHithub commented 2 years ago

😵 Describe the installation problem

When I run the code of GPT-GNN, It report that

Traceback (most recent call last):
  File "finetune_OAG_PF.py", line 3, in <module>
    from GPT_GNN.model import *
  File "/home/DYT/GPTuning/GPT-GNN/example_OAG/GPT_GNN/model.py", line 1, in <module>
    from .conv import *
  File "/home/DYT/GPTuning/GPT-GNN/example_OAG/GPT_GNN/conv.py", line 5, in <module>
    from torch_geometric.nn import GCNConv, GATConv, RGCNConv
  File "/home/chenliyi/anaconda3/envs/pygt1.5/lib/python3.6/site-packages/torch_geometric/__init__.py", line 2, in <module>
    import torch_geometric.nn
  File "/home/chenliyi/anaconda3/envs/pygt1.5/lib/python3.6/site-packages/torch_geometric/nn/__init__.py", line 2, in <module>
    from .data_parallel import DataParallel
  File "/home/chenliyi/anaconda3/envs/pygt1.5/lib/python3.6/site-packages/torch_geometric/nn/data_parallel.py", line 5, in <module>
    from torch_geometric.data import Batch
  File "/home/chenliyi/anaconda3/envs/pygt1.5/lib/python3.6/site-packages/torch_geometric/data/__init__.py", line 1, in <module>
    from .data import Data
  File "/home/chenliyi/anaconda3/envs/pygt1.5/lib/python3.6/site-packages/torch_geometric/data/data.py", line 7, in <module>
    from torch_sparse import coalesce
  File "/home/chenliyi/anaconda3/envs/pygt1.5/lib/python3.6/site-packages/torch_sparse/__init__.py", line 2, in <module>
    from .coalesce import coalesce
  File "/home/chenliyi/anaconda3/envs/pygt1.5/lib/python3.6/site-packages/torch_sparse/coalesce.py", line 2, in <module>
    import torch_scatter
  File "/home/chenliyi/anaconda3/envs/pygt1.5/lib/python3.6/site-packages/torch_scatter/__init__.py", line 3, in <module>
    from .mul import scatter_mul
  File "/home/chenliyi/anaconda3/envs/pygt1.5/lib/python3.6/site-packages/torch_scatter/mul.py", line 3, in <module>
    from torch_scatter.utils.ext import get_func
  File "/home/chenliyi/anaconda3/envs/pygt1.5/lib/python3.6/site-packages/torch_scatter/utils/ext.py", line 2, in <module>
    import torch_scatter.scatter_cpu
ImportError: /home/chenliyi/anaconda3/envs/pygt1.5/lib/python3.6/site-packages/torch_scatter/scatter_cpu.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN6caffe26detail37_typeMetaDataInstance_preallocated_32E

Is there any method to fix it? thank you!

Environment

rusty1s commented 2 years ago

Can you share information about installation logs? There also are wheels available for pyTorch 1.5.0 which should simplify installation, see here.