之前下载后总是报错
直接下载whl文件pip install 都还是报错
OSError Traceback (most recent call last)
/tmp/ipykernel_1271/4108300309.py in
----> 1 from torch_scatter import scatter
~/miniconda3/lib/python3.8/site-packages/torch_scatter/init.py in
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’:
18 raise ImportError(f"Could not find module ‘{library}_cpu’ in "
~/miniconda3/lib/python3.8/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
~/miniconda3/lib/python3.8/ctypes/init.py in init(self, name, mode, handle, use_errno, use_last_error, winmode)
379
380 if handle is None:
–> 381 self._handle = _dlopen(self._name, mode)
382 else:
383 self._handle = handle
/root/miniconda3/lib/python3.8/site-packages/torch_scatter/_version_cuda.so: undefined symbol: ZN3c106detail23torchInternalAssertFailEPKcS2_jS2_S2
重新下载后好了
pip install --no-index torch-scatter -f https://pytorch-geometric.com/whl/torch-1.7.0+cu102.html
也可以改变后面的torch和cuda的版本号
pip install --no-index torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.1+cu111.html
安装torch sparse
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.8.1+cu111.html