pyg-team / pytorch_geometric

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

Unable to train using Ubuntu or CentOS #3850

Open pjuangph opened 2 years ago

pjuangph commented 2 years ago

🐛 Bug

There seems to be a bug with detecting the CPU in torch_sparse. Has anyone encountered this on their end?

To Reproduce

I would love to share with you all the code but at the moment I can't. I am training with SplineConv. It works fine with windows and mac. It fails on Ubuntu OS and CentOS. I am running with latest drivers Nvidia 470

Expected behavior

Environment

Additional context

Traceback (most recent call last): File "/u/pjuangph/github/Airfoil-Learning/pytorch/train_gnn.py", line 7, in from torch_geometric.loader import DataLoader File "/u/pjuangph/.conda/envs/gnn/lib/python3.9/site-packages/torch_geometric/init.py", line 7, in import torch_geometric.data File "/u/pjuangph/.conda/envs/gnn/lib/python3.9/site-packages/torch_geometric/data/init.py", line 1, in from .data import Data File "/u/pjuangph/.conda/envs/gnn/lib/python3.9/site-packages/torch_geometric/data/data.py", line 3, in from torch_geometric.typing import OptTensor File "/u/pjuangph/.conda/envs/gnn/lib/python3.9/site-packages/torch_geometric/typing.py", line 4, in from torch_sparse import SparseTensor File "/u/pjuangph/.conda/envs/gnn/lib/python3.9/site-packages/torch_sparse/init.py", line 15, in torch.ops.load_library(importlib.machinery.PathFinder().find_spec( File "/u/pjuangph/.conda/envs/gnn/lib/python3.9/site-packages/torch/_ops.py", line 104, in load_library ctypes.CDLL(path) File "/u/pjuangph/.conda/envs/gnn/lib/python3.9/ctypes/init.py", line 382, in init self._handle = _dlopen(self._name, mode) OSError: /u/pjuangph/.conda/envs/gnn/lib/python3.9/site-packages/torch_sparse/_version_cpu.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs

rusty1s commented 2 years ago

This error is typically related to some version inconsistency during installation. You may try to install the package from source to fix, e.g., via

pip install --verbose torch-scatter torch-sparse

Let me know if that works for you (might take some time to compile).