使用pip安装PyTorch时报如下错误:
ERROR: Could not find a version that satisfies the requirement torch>=1.6.0 (from -r requirements.txt (line 11)) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch>=1.6.0 (from -r requirements.txt (line 11))
pip安装Pytorch时使用国内镜像源,会报如上错误。解决方案如下:
参考:https://blog.youkuaiyun.com/Jwenxue/article/details/107520422中给出的网址,选择合适的版本,根据给出的命令:
比如:pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
到网址:https://download.pytorch.org/whl/torch_stable.html选择合适的版本,使用迅雷下载,完成后再使用pip安装即可。
进入下载的whl文件目录,运行如下命令:
pip install "torch-1.6.0+cu101-cp38-cp38-win_amd64.whl" "torchvision-0.7.0+cu101-cp38-cp38-win_amd64.whl"