![CUDA11.2 安装pytorch报错:ERROR: Could not install packages due to an OSError: [Errno 2] No such file or,第1张 CUDA11.2 安装pytorch报错:ERROR: Could not install packages due to an OSError: [Errno 2] No such file or,第1张](/aiimages/CUDA11.2+%E5%AE%89%E8%A3%85pytorch%E6%8A%A5%E9%94%99%EF%BC%9AERROR%3A+Could+not+install+packages+due+to+an+OSError%3A+%5BErrno+2%5D+No+such+file+or.png)
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版本不兼容的问题!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)