pytorch_geometric: Cannot import torch-spline-conv when installed from pip wheel in Torch 1.9.0 and CUDA 11.1
π Installation
I had been able install all pytorch-geometric related packages via pip prior to the new 1.7.1 release and it all works well. However, with the new release, pip install
seems to skip βbuilding the wheelβ for torch-spline-conv, but still give a successful installation. When importing the torch-spline-conv, it then gives this error:
β> 46 from torch_geometric.nn import MetaPath2Vec
/opt/anaconda3/lib/python3.7/site-packages/torch_geometric/nn/init.py in <module> 3 from .data_parallel import DataParallel 4 from .reshape import Reshape ----> 5 from .conv import * # noqa 6 from .norm import * # noqa 7 from .glob import * # noqa
/opt/anaconda3/lib/python3.7/site-packages/torch_geometric/nn/conv/init.py in <module> 22 from .point_conv import PointConv 23 from .gmm_conv import GMMConv β> 24 from .spline_conv import SplineConv 25 from .nn_conv import NNConv, ECConv 26 from .cg_conv import CGConv
/opt/anaconda3/lib/python3.7/site-packages/torch_geometric/nn/conv/spline_conv.py in <module> 12 13 try: β> 14 from torch_spline_conv import spline_basis, spline_weighting 15 except ImportError: 16 spline_basis = None
/opt/anaconda3/lib/python3.7/site-packages/torch_spline_conv/init.py in <module> 10 for library in [β_versionβ, β_basisβ, βweightingβ]: 11 torch.ops.load_library(importlib.machinery.PathFinder().find_spec( β> 12 fβ{library}{suffix}β, [osp.dirname(file)]).origin) 13 14 if torch.cuda.is_available(): # pragma: no cover
/opt/anaconda3/lib/python3.7/site-packages/torch/_ops.py in load_library(self, path) 102 # static (global) initialization code in order to register custom 103 # operators with the JIT. β> 104 ctypes.CDLL(path) 105 self.loaded_libraries.add(path) 106
/opt/anaconda3/lib/python3.7/ctypes/init.py in init(self, name, mode, handle, use_errno, use_last_error) 362 363 if handle is None: β> 364 self._handle = _dlopen(self._name, mode) 365 else: 366 self._handle = handle
OSError: /lib64/libm.so.6: version `GLIBC_2.27β not found (required by /opt/anaconda3/lib/python3.7/site-packages/torch_spline_conv/_basis_cuda.so)
Environment
- OS: Centos 7
- Python version: 3.7
- PyTorch version: 1.9
- CUDA/cuDNN version: 11.1
- GCC version: 6.3.0
- How did you try to install PyTorch Geometric and its extensions (wheel, source): wheel
- Any other relevant information:
CUDA=βcu111β pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+${CUDA}.html pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.9.0+${CUDA}.html pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.9.0+${CUDA}.html pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.9.0+${CUDA}.html
Checklist
- I followed the installation guide.
- I cannot find my error message in the FAQ.
- I set up CUDA correctly and can compile CUDA code via
nvcc
. - I do have multiple CUDA versions on my machine.
Additional context
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (10 by maintainers)
FYI, it seems that this issue persists with torch 1.11.0, however uninstalling
torch-spline-conv
solves the problem.Iβd like to reopen this issue since building from source doesnβt fix the underlying problem of the wheels. It doesnβt seem to be a CUDA version specific issue, since Iβve experienced the same with CUDA 10.2. Moreover, Iβve tested it with several python versions, from
3.7
to3.9
, but without success.Reproducibility
Pytorch and dependencies installed with
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
torch-spline-conv
installed with:Python output
The bug only shows up in a CUDA capable machine. Importing the module on a machine without CUDA support works fine. Iβll be happy to report additional details as well as submit this issue on the official
torch-spline-conv
repository.Ok, Iβm trying to track this issue down, but itβs unclear to me why imports of other packages work fine, while it fails for
torch-spline-conv
. Do you needSplineConv
in your work? Other-wise feel free to uninstall it as it is an optional dependency by now.Other-wise, you can try multiple options:
torch-spline-conv
from source and see if that works (pip install torch-spline-conv
)You should also check what version of glibc you have on your CentOS 7 machine.