温馨提示:本文翻译自stackoverflow.com,查看原文请点击:python - Install PyTorch from requirements.txt
pip python pytorch requirements.txt

python - 从requirements.txt安装PyTorch

发布于 2020-06-15 09:57:17

Torch文档说可以pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html用来安装最新版本的PyTorch。当我手动执行此操作时,但是将其添加到req.txt并执行操作时pip install -r req.txt,它会失败并显示 ERROR: No matching distribution

编辑:从req.txt中添加整行,并在此处出错。

torch==1.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html

torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.htmltorch==1.4.0+cpu

ERROR: Could not find a version that satisfies the requirement torch==1.4.0+cpu (from -r requirements.txt (line 1)) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 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.3.0, 1.3.1, 1.4.0) ERROR: No matching distribution found for torch==1.4.0+cpu (from -r requirements.txt (line 1))

查看更多

提问者
Siddharth Prajosh
被浏览
23
Siddharth Prajosh 2020-04-01 15:32

--find-links在割炬之前添加requirements.txt

--find-links https://download.pytorch.org/whl/torch_stable.html

torch==1.2.0+cpu

来源:https : //github.com/pytorch/pytorch/issues/29745#issuecomment-553588171