我已经按照www.example.com上推荐的方式安装了pytorch,使用的命令如下:pytorch.org using this command:
sudo pip3 install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2
但是在安装之后,我用pytorch运行一个python脚本并得到错误:
/home/vic/.local/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: libc10_cuda.so: cannot open shared object file: No such file or directory
warn(f"Failed to load image Python extension: {e}")
怎么解决呢?
手电筒版本:
import torch
torch.__version__
'1.13.1+rocm5.2'
Torchvision版本(错误):
import torchvision
/home/vic/.local/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: libc10_cuda.so: cannot open shared object file: No such file or directory
warn(f"Failed to load image Python extension: {e}")
1条答案
按热度按时间h5qlskok1#
从/home/维克/.local/lib/python3.10/site-packages/中删除所有与torch相关的目录,然后重新安装torch,所有问题都得到了解决。