CUDA11.2 安装pytorch报错:ERROR: Could not install packages due to an OSError: [Errno 2] No such file or
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/root/anaconda3/envs/mmdetection/lib/python3.7/site-packages/torch/_C.cpython-37m-x86_64-linux-gnu.so'
·
ubuntu服务器CUDA版本为11.2,查询官网发现pytorch没有对应版本,直接安装CUDA11.3版本的torch:
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
报错如下:
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/root/anaconda3/envs/mmdetection/lib/python3.7/site-packages/torch/_C.cpython-37m-x86_64-linux-gnu.so'
此报错与pytorch版本和cuda版本不对应无关,是权限不足引发的报错,解决方法为在pip install后面加上--user:
pip3 install --user torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
torch安装成功,代码能够成功运行,没有与CUDA版本不兼容的问题!
更多推荐
已为社区贡献1条内容
所有评论(0)