[英]Could not import torch_geometric, it says "undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs"
I am trying to find a solution to the error: OSError: /opt/conda/lib/python3.7/site-packages/torch_sparse/_version_cuda.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs .我正在尝试找到错误的解决方案: OSError: /opt/conda/lib/python3.7/site-packages/torch_sparse/_version_cuda.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs 。
arising from the statement from torch_geometric.data import Data
in Kaggle notebook. from torch_geometric.data import Data
在 Kaggle notebook 中的声明。
There are solutions in github and stackoverflow , but none are working. github和stackoverflow中有解决方案,但都没有用。
-- "nvcc --version" shows -- "nvcc --version" 显示
"nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2020 NVIDIA Corporation Built on Wed_Jul_22_19:09:09_PDT_2020 Cuda compilation tools, release 11.0, V11.0.221 Build cuda_11.0_bu.TC445_37.28845127_0" “nvcc:NVIDIA (R) Cuda 编译器驱动程序 版权所有 (c) 2005-2020 NVIDIA Corporation Built on Wed_Jul_22_19:09:09_PDT_2020 Cuda 编译工具,版本 11.0,V11.0.221 Build cuda_11.0_bu.TC445_372.27804”5
I tried to install torch-geometric by我尝试通过以下方式安装 torch-geometric
!conda install pyg -c pyg -c conda-forge !conda 安装 pyg -c pyg -c conda-forge
!pip install pyg-lib torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.12.0+cu113.html !pip 安装 pyg-lib torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.12.0+cu113.html
The first statement took more than 1 hour so I moved to the second, which installed it.第一个声明花了 1 个多小时,所以我转到第二个,安装了它。 But the error didn't go.但是错误并没有go。
It is running with out any error in colab.它在 colab 中运行时没有任何错误。
This issue is mentionned at https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html :在https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html中提到了这个问题:
undefined symbol: make_function_schema : This issue signals (1) a version conflict between your installed PyTorch version and the ${TORCH} version specified to install the extension packages, or (2) a version conflict between the installed CUDA version of PyTorch and the ${CUDA} version specified to install the extension packages. undefined symbol: make_function_schema :此问题表示 (1) 安装的 PyTorch 版本与指定用于安装扩展包的 ${TORCH} 版本之间存在版本冲突,或者 (2) 安装的 CUDA 版本的 PyTorch 与 ${TORCH} 版本之间存在版本冲突{CUDA} 指定安装扩展包的版本。 Please verify that your PyTorch version and its CUDA version match with your installation command:请验证您的 PyTorch 版本及其 CUDA 版本是否与您的安装命令匹配:
python -c "import torch; print(torch.__version__)"
python -c "import torch; print(torch.version.cuda)"
nvcc --version
For re-installation, ensure that you do not run into any caching issues by using the pip --force-reinstall --no-cache-dir flags.对于重新安装,请使用 pip --force-reinstall --no-cache-dir 标志确保您不会遇到任何缓存问题。 In addition, the pip --verbose option may help to track down any issues during installation.此外,pip --verbose 选项可能有助于追踪安装期间的任何问题。 If you still do not find any success in installation, please try to install the extension packages from source.如果您仍然没有发现安装成功,请尝试从源安装扩展包。
So, I would try these commands, and re-install all or part of the packages into a fresh environment.因此,我会尝试这些命令,并将所有或部分软件包重新安装到新环境中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.