求助:执行pip install -r requirements.txt遇torch版本匹配错误
解决torch==1.11.0+cu113安装失败问题
- 该版本无法通过默认pip源找到,因为PyTorch的CUDA专属版本未上传至默认PyPI索引,需指定官方源安装
- 先清理已安装的torch(若存在):
pip uninstall -y torch - 直接安装指定版本:
pip install torch==1.11.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html - 若要通过
requirements.txt安装,修改文件中对应行:
再执行torch==1.11.0+cu113 --find-links https://download.pytorch.org/whl/cu113/torch_stable.htmlpip install -r requirements.txt - 验证安装结果:
正常情况下会分别输出import torch print(torch.version.cuda) print(torch.__version__)11.3和1.11.0+cu113
内容的提问来源于stack exchange,提问作者o k
相关产品推荐
相关产品推荐

