解决torch安装时版本找不到报错问题

报错Could not find a version that satisfies the requirement torch==1.0.0 (from versions: none)

解决:

1、换镜像,比如pip install -i http://mirrors.aliyun.com/pypi/simple/ torch==1.0.0

2、去官网找whl文件。老版本这里都有Previous PyTorch Versions | PyTorch。可以进https://download.pytorch.org/whl/cpu/torch_stable.html下载torch和torchvision的whl文件。

  • 直接使用pip install torch是默认安装的cpu版本,所以最好到官网指定版本,可以用torch.cuda.is_available()命令检查。
  • 要找好和自己电脑配置一致的版本,cu表示cuda版本(GPU),torch后面的是torch的版本,cp后面的python的版本,电脑是win64。
  • 进whl所在文件夹cmd后,类似pip install torch-1.0.0-cp37-cp37m-win_amd64.whl即可。
  • 3、把pip的下载链接改为官网,比如pip install torch==1.0.0 -f https://download.pytorch.org/whl/torch_stable.html

    4、如果可以的话,换个相近的高版本吧

    物联沃分享整理
    物联沃-IOTWORD物联网 » 解决torch安装时版本找不到报错问题

    发表评论