pytorch_sparse icon indicating copy to clipboard operation
pytorch_sparse copied to clipboard

(Import Erro)undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs

Open beeeginner opened this issue 2 years ago • 1 comments
trafficstars

I ran this on kaggle notebook: !pip install torch_geometric !pip install torch-scatter==2.1.1 torch-sparse==0.6.17 -f https://data.pyg.org/whl/torch-2.0.0+cu118.html And it said Installing collected packages: torch-scatter, torch-sparse Successfully installed torch-scatter-2.1.1+pt20cu118 torch-sparse-0.6.17+pt20cu118 And then I tried to import,then this purpluxing Erro ocurred,wat???

Env:torch 2.0.0+cuda118,torch_geometric 2.4.0

OSError Traceback (most recent call last) Cell In[4], line 1 ----> 1 import torch_scatter 2 import torch_sparse

File /opt/conda/lib/python3.10/site-packages/torch_scatter/init.py:16 14 spec = cuda_spec or cpu_spec 15 if spec is not None: ---> 16 torch.ops.load_library(spec.origin) 17 elif os.getenv('BUILD_DOCS', '0') != '1': # pragma: no cover 18 raise ImportError(f"Could not find module '{library}_cpu' in " 19 f"{osp.dirname(file)}")

File /opt/conda/lib/python3.10/site-packages/torch/_ops.py:643, in _Ops.load_library(self, path) 638 path = _utils_internal.resolve_library_path(path) 639 with dl_open_guard(): 640 # Import the shared library into the process, thus running its 641 # static (global) initialization code in order to register custom 642 # operators with the JIT. --> 643 ctypes.CDLL(path) 644 self.loaded_libraries.add(path)

File /opt/conda/lib/python3.10/ctypes/init.py:374, in CDLL.init(self, name, mode, handle, use_errno, use_last_error, winmode) 371 self._FuncPtr = _FuncPtr 373 if handle is None: --> 374 self._handle = _dlopen(self._name, mode) 375 else: 376 self._handle = handle

OSError: /opt/conda/lib/python3.10/site-packages/torch_scatter/_version_cuda.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs

beeeginner avatar Nov 03 '23 03:11 beeeginner

Does Kaggle Notebooks come with PyTorch pre-installed? It looks like they may not use the official PyTorch build, which causes problems down the road. Theoretically, this can be resolved by manual installation

pip install torch-scatter==2.1.1 torch-sparse==0.6.17

which may take some time. Please also note that later versions of PyG treat these dependencies as optional, so if you don't necessarily need SparseTensor support, there is no need to install them.

rusty1s avatar Nov 06 '23 10:11 rusty1s

This issue had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity. Is this issue already resolved?

github-actions[bot] avatar May 05 '24 01:05 github-actions[bot]