Anaconda, update Pytorch to the latest version 1.5

vpap picture vpap · Apr 6, 2020 · Viewed 16.2k times · Source

How could I update PyTorch from 1.4 -> 1.5 using Anaconda either through terminal or navigator?

Updating Anaconda with conda update --all updated some of the packages, not all, PyTorch included.

Initially, I installed PyTorch by running conda install -c pytorch pytorch

From PyTorch Github page there's the command

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

but I wonder if there's going to be any kind of conflict between the already installed version and this one.

Thanks

Answer

Berriel picture Berriel · Apr 7, 2020

PyTorch latest stable release (as of April 06, 2020) is still 1.4, as you can see here.

Therefore, if you want to install the nightly build (which is on track to the 1.5) using conda, you can follow the 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

or the CPU-only version:

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

Or, you can just wait 1.5 to be an stable release (currently, we are in the release candidate 2) and update the pytorch package as you'd have done otherwise.


Be aware that:

PyTorch 1.4 is the last release that supports Python 2

So, if you're moving to PyTorch 1.5, say goodbye to Python 2 (Yay!!).