CUDA11.2 安装pytorch报错:ERROR: Could not install packages due to an OSError: [Errno 2] No such file or

CUDA11.2 安装pytorch报错:ERROR: Could not install packages due to an OSError: [Errno 2] No such file or,第1张

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版本不兼容的问题!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/569427.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-04-09
下一篇2022-04-09

发表评论

登录后才能评论

评论列表(0条)

    保存