如何正确安装Pytorch?
导入Pytorch时,我会收到以下错误:
python -c "import torch; print(torch.version.cuda)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/vision/anaconda3/envs/psf/lib/python3.7/site-packages/torch/__init__.py", line 197, in <module>
from torch._C import * # noqa: F403
ImportError: /home/vision/anaconda3/envs/psf/lib/python3.7/site-packages/torch/lib/libtorch_cpu.so:
undefined symbol: _ZNK3c1010TensorImpl23shallow_copy_and_detachERKNS_15VariableVersionEb
我安装了Pytorch
pip3 install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit==11.3 -f https://download.pytorch.org/whl/torch_stable.html
,我的CUDA版本是:
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_May__3_19:15:13_PDT_2021
Cuda compilation tools, release 11.3, V11.3.109
Build cuda_11.3.r11.3/compiler.29920130_0
请我需要帮助
I get the following error when importing pytorch:
python -c "import torch; print(torch.version.cuda)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/vision/anaconda3/envs/psf/lib/python3.7/site-packages/torch/__init__.py", line 197, in <module>
from torch._C import * # noqa: F403
ImportError: /home/vision/anaconda3/envs/psf/lib/python3.7/site-packages/torch/lib/libtorch_cpu.so:
undefined symbol: _ZNK3c1010TensorImpl23shallow_copy_and_detachERKNS_15VariableVersionEb
These are the relevant package versions:
I installed pytorch through
pip3 install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit==11.3 -f https://download.pytorch.org/whl/torch_stable.html
and my cuda version is:
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_May__3_19:15:13_PDT_2021
Cuda compilation tools, release 11.3, V11.3.109
Build cuda_11.3.r11.3/compiler.29920130_0
Please I need help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论