Anaconda,更新Pytorch到最新版本1.5

Anaconda, update Pytorch to the latest version 1.5

我如何通过终端或导航器使用 Anaconda 从 1.4 -> 1.5 更新 PyTorch?

conda update --all 更新 Anaconda 更新了一些包,不是全部,包括 PyTorch。

最初,我通过 运行 conda install -c pytorch pytorch

安装了 PyTorch

从 PyTorch Github 页面有命令

conda install -c pytorch magma-cuda90 # or [magma-cuda92 | magma-cuda100 | magma-cuda101 ] depending on your cuda version

但我想知道已经安装的版本和这个版本之间是否会有任何冲突。

谢谢

PyTorch 最新稳定版本(截至 2020 年 4 月 6 日)仍然是 1.4,如您所见here

因此,如果您想使用 conda 安装 nightly build(正在跟踪 1.5),您可以按照 official instructions:

  • Cuda 10.1:
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch-nightly -c defaults -c conda-forge
  • Cuda 9.2:
conda install pytorch torchvision cudatoolkit=9.2 -c pytorch-nightly -c defaults -c conda-forge -c numba/label/dev

或仅 CPU 版本:

conda install pytorch torchvision cpuonly -c pytorch-nightly -c defaults -c conda-forge

或者,您可以等待 1.5 成为稳定版本(目前,我们处于 release candidate 2)并更新 pytorch 包,否则您会这样做。


请注意:

PyTorch 1.4 is the last release that supports Python 2

因此,如果您要迁移到 PyTorch 1.5,请告别 Python2(耶!!)。