Ubuntu 安装 Pytorch 报错 + 解决记录

一、背景

环境:Ubuntu 操作系统、无 GPU、pip 安装、Python 语言

官网:https://pytorch.org/

按照官网操作选择环境,生成命令:

pip install torch==1.5.1+cpu torchvision==0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

报错:

ERROR: Could not find a version that satisfies the requirement torch==1.5.1+cpu (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 0.1.6.post17, 0.1.6.post20, 0.3.0.post4, 0.3.1, 0.4.0, 0.4.1, 1.0.0, 1.0.1, 1.0.1.post2, 1.1.0, 1.2.0, 1.2.0+cpu, 1.2.0+cu92, 1.3.0, 1.3.0+cpu, 1.3.0+cu100, 1.3.0+cu92, 1.3.1, 1.3.1+cpu, 1.3.1+cu100, 1.3.1+cu92, 1.4.0, 1.4.0+cpu, 1.4.0+cu100, 1.4.0+cu92, 1.5.0+cpu, 1.5.0+cu92)
ERROR: No matching distribution found for torch==1.5.1+cpu

二、解决方案

安装低版本的 Pytorch:v1.2.0

# CPU only
pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html

成功安装!

猜你喜欢

转载自blog.csdn.net/qq_36627158/article/details/106940623
今日推荐