如何安装旧版本的PyTorch

5

根据https://pytorch.org/get-started/previous-versions/#via-pip,执行以下步骤:

pip install torch==0.2.0_4 -f https://download.pytorch.org/whl/cpu/stable
Collecting torch==0.2.0_4
  Could not find a version that satisfies the requirement torch==0.2.0_4 (from versions: 0.1.2, 0.1.2.post1, 0.3.1, 0.4.0, 0.4.1, 1.0.0, 1.0.1, 1.0.1.post2, 1.1.0)
No matching distribution found for torch==0.2.0_4

如何安装pytorch的旧版本?

https://discuss.pytorch.org/t/how-to-switch-to-older-version-of-pytorch/19656 - Channa
你尝试过使用以下命令安装PyTorch吗?conda install pytorch==1.7.1 torchvision cudatoolkit=10.2 -c pytorch - Charlie Parker
2个回答

5
pip install torch==

Collecting torch==

错误:找不到满足要求 torch==(可用版本:0.1.2、0.1.2.post1、0.4.1、1.0.0、1.0.1、1.0.1.post2、1.1.0) 错误:找不到匹配的发行版以安装 torch==

这意味着版本0.2不可用。

您可以通过下载特定版本(似乎有可用的wheels),然后使用pip install来进行安装。


如何安装适合的 torchvision 版本?pip install torchvision 会安装一些其他的 pytorch 版本,覆盖了 whl 安装的版本。 - mrgloom
不确定是否理解。无论如何,最好创建一个虚拟环境,并安装每个软件包所需的版本,以避免冲突。 - abc
对于我的情况,似乎是 pip install torchvision==0.2.0 --no-deps --no-cache-dir - mrgloom

1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接