rusty1s / pytorch_scatter

PyTorch Extension Library of Optimized Scatter Operations

Home Page:https://pytorch-scatter.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with torch_scatter when compiling

turexx opened this issue · comments

Hi everyone, an error occurred with torch_scatter. I'm using a conda environment with python 3.9.
I think is a compatibility-based error.
Traceback (most recent call last): File "/Users/turex/Desktop/graph-generation-EDGE/train.py", line 3, in <module> from diffusion.utils import add_parent_path, set_seeds File "/Users/turex/Desktop/graph-generation-EDGE/diffusion/__init__.py", line 2, in <module> from .diffusion_base import * File "/Users/turex/Desktop/graph-generation-EDGE/diffusion/diffusion_base.py", line 5, in <module> from torch_scatter import scatter File "/opt/anaconda3/envs/edge/lib/python3.9/site-packages/torch_scatter/__init__.py", line 13, in <module> torch.ops.load_library(importlib.machinery.PathFinder().find_spec( File "/opt/anaconda3/envs/edge/lib/python3.9/site-packages/torch/_ops.py", line 933, in load_library ctypes.CDLL(path) File "/opt/anaconda3/envs/edge/lib/python3.9/ctypes/__init__.py", line 382, in __init__ self._handle = _dlopen(self._name, mode) OSError: dlopen(/opt/anaconda3/envs/edge/lib/python3.9/site-packages/torch_scatter/_version_cpu.so, 0x0006): Symbol not found: __ZN3c1017RegisterOperatorsD1Ev

I already tried conda update --all but nothing changed.

This usually indicates that the PyTorch version used to compile torch-scatter is different from the one you are using. How did you install torch-scatter when what are the versions shown by conda?

I installed torch-scatter with conda install conda-forge::torch-scatter. Actually, if I check the conda version it prints out this turex@192 envs % conda list torch_scatter packages in environment at /opt/anaconda3/envs/edge: Name Version Build Channel

Seems weird cause inside edge torch-scatter is present.

We don't maintain the conda-forge package of torch-scatter. Can you install via conda -c pyg from pyg channel?

By doing this conda install pytorch-scatter -c pyg I have a lot of conflicts between the packages.

Can you show me the output of conda list?

`turex@192 graph-generation-EDGE % conda list
packages in environment at /opt/anaconda3/envs/edge:

Name Version Build Channel
appnope 0.1.2 py39hecd8cb5_1001
asttokens 2.0.5 pyhd3eb1b0_0
backcall 0.2.0 pyhd3eb1b0_0
blas 1.0 mkl
ca-certificates 2023.12.12 hecd8cb5_0
certifi 2024.2.2 py39hecd8cb5_0
charset-normalizer 2.0.4 pyhd3eb1b0_0
comm 0.1.2 py39hecd8cb5_0
cpuonly 2.0 0 pytorch
debugpy 1.6.7 py39hcec6c5f_0
decorator 5.1.1 pyhd3eb1b0_0
dgl 2.0.0 py39_0 dglteam
exceptiongroup 1.2.0 py39hecd8cb5_0
executing 0.8.3 pyhd3eb1b0_0
filelock 3.13.1 py39hecd8cb5_0
freetype 2.12.1 hd8bbffd_0
gmp 6.2.1 he9d5cce_3
gmpy2 2.1.2 py39hd5de756_0
idna 3.4 py39hecd8cb5_0
importlib-metadata 7.0.1 py39hecd8cb5_0
importlib_metadata 7.0.1 hd3eb1b0_0
intel-openmp 2023.1.0 ha357a0b_43548
ipykernel 6.28.0 py39hecd8cb5_0
ipython 8.15.0 py39hecd8cb5_0
jedi 0.18.1 py39hecd8cb5_1
jinja2 3.1.3 py39hecd8cb5_0
jpeg 9e h6c40b1e_1
jupyter_client 8.6.0 py39hecd8cb5_0
jupyter_core 5.5.0 py39hecd8cb5_0
lcms2 2.12 hf1fd2bf_0
lerc 3.0 he9d5cce_0
libcxx 14.0.6 h9765a3e_0
libdeflate 1.17 hb664fd8_1
libffi 3.4.4 hecd8cb5_0
libgfortran 5.0.0 11_3_0_hecd8cb5_28
libgfortran5 11.3.0 h9dfd629_28
libpng 1.6.39 h6c40b1e_0
libsodium 1.0.18 h1de35cc_0
libtiff 4.5.1 hcec6c5f_0
libwebp-base 1.3.2 h6c40b1e_0
llvm-openmp 14.0.6 h0dcd299_0
lz4-c 1.9.4 hcec6c5f_0
markupsafe 2.1.3 py39h6c40b1e_0
matplotlib-inline 0.1.6 py39hecd8cb5_0
mkl 2023.1.0 h8e150cf_43560
mkl-service 2.4.0 py39h6c40b1e_1
mkl_fft 1.3.8 py39h6c40b1e_0
mkl_random 1.2.4 py39ha357a0b_0
mpc 1.1.0 h6ef4df4_1
mpfr 4.0.2 h9066e36_1
mpmath 1.3.0 py39hecd8cb5_0
ncurses 6.4 hcec6c5f_0
nest-asyncio 1.5.6 py39hecd8cb5_0
networkx 3.1 py39hecd8cb5_0
numpy 1.26.3 py39h827a554_0
numpy-base 1.26.3 py39ha186be2_0
openjpeg 2.4.0 h66ea3da_0
openssl 3.0.13 hca72f7f_0
packaging 23.1 py39hecd8cb5_0
parso 0.8.3 pyhd3eb1b0_0
pexpect 4.8.0 pyhd3eb1b0_3
pickleshare 0.7.5 pyhd3eb1b0_1003
pillow 10.2.0 py39h6c40b1e_0
pip 23.3.1 py39hecd8cb5_0
platformdirs 3.10.0 py39hecd8cb5_0
prettytable 3.5.0 py39hecd8cb5_0
prompt-toolkit 3.0.43 py39hecd8cb5_0
psutil 5.9.0 py39hca72f7f_0
ptyprocess 0.7.0 pyhd3eb1b0_2
pure_eval 0.2.2 pyhd3eb1b0_0
pygments 2.15.1 py39hecd8cb5_1
python 3.9.18 h5ee71fb_0
python-dateutil 2.8.2 pyhd3eb1b0_0
python_abi 3.9 2_cp39 conda-forge
pytorch 2.2.0 py3.9_0 pytorch
pytorch-mutex 1.0 cpu pytorch
pyyaml 6.0.1 py39h6c40b1e_0
pyzmq 25.1.2 py39hcec6c5f_0
readline 8.2 hca72f7f_0
requests 2.31.0 py39hecd8cb5_1
scipy 1.11.4 py39hdb2ea58_0
setuptools 68.2.2 py39hecd8cb5_0
six 1.16.0 pyhd3eb1b0_1
sqlite 3.41.2 h6c40b1e_0
stack_data 0.2.0 pyhd3eb1b0_0
sympy 1.12 py39hecd8cb5_0
tbb 2021.8.0 ha357a0b_0
tk 8.6.12 h5d9f67b_0
torch-scatter 2.0.8 py39hd475443_0 conda-forge
torchaudio 2.2.0 py39_cpu pytorch
torchvision 0.15.2 cpu_py39h04f087f_0
tornado 6.3.3 py39h6c40b1e_0
tqdm 4.65.0 py39h01d92e1_0
traitlets 5.7.1 py39hecd8cb5_0
typing_extensions 4.9.0 py39hecd8cb5_1
tzdata 2023d h04d1e81_0
urllib3 2.1.0 py39hecd8cb5_0
wcwidth 0.2.5 pyhd3eb1b0_0
wheel 0.41.2 py39hecd8cb5_0
xz 5.4.5 h6c40b1e_0
yaml 0.2.5 haf1e3a3_0
zeromq 4.3.5 hcec6c5f_0
zipp 3.17.0 py39hecd8cb5_0
zlib 1.2.13 h4dc903c_0
zstd 1.5.5 hc035e20_0 `

Yeah, this is likely an issue due to torch-scatter being installed from conda-forge. For this, you either need PyTorch from conda-forge as well, or use the pyg channel to install torch-scatter.

Unfortunately the problem still exists. When I try to install pytorch-scatter from pyg or conda-forge it results in an error like:
conda create --name pyg2.4 boost boost-cpp pytorch::pytorch torchvision torchaudio pytorch-scatter graph-tool dill tqdm numpy pyg scipy pandas seaborn python -c pyg -c pytorch -c conda-forge -c anaconda

`
Channels:

  • pyg
  • pytorch
  • conda-forge
  • anaconda
  • defaults
    Platform: osx-arm64
    Collecting package metadata (repodata.json): done
    Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  • pytorch::pytorch
  • pytorch-scatter
  • pyg

Current channels:

To search for alternate channels that may provide the conda package you're
looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.`

Is this on Mac M1? We don't provide conda builds for ARM-based Macs (yet). In this case, you have to install torch-scatter from source.