Installing previous versions of PyTorch

We’d prefer you install the latest version, but old binaries and installation instructions are provided below for your convenience.

Via conda

This should be used for most previous macOS version installs.

To install a previous version of PyTorch via Anaconda or Miniconda, replace “0.4.1” in the following commands with the desired version (i.e., “0.2.0”).

Installing with CUDA 9

conda install pytorch=0.4.1 cuda90 -c pytorch

or

conda install pytorch=0.4.1 cuda92 -c pytorch

Installing with CUDA 8

conda install pytorch=0.4.1 cuda80 -c pytorch

Installing with CUDA 7.5

conda install pytorch=0.4.1 cuda75 -c pytorch

Installing without CUDA

conda install pytorch=0.4.1 -c pytorch

From source

It is possible to checkout an older version of PyTorch and build it. You can list tags in PyTorch git repository with git tag and checkout a particular one (replace ‘0.1.9’ with the desired version) with

git checkout v0.1.9

Follow the install from source instructions in the README.md of the PyTorch checkout.

Via pip

Download the whl file with the desired version via this command (you can replace 1.0.1 with the version you choose):

pip install torch==1.0.1 -f https://download.pytorch.org/whl/cpu/stable # CPU-only build
pip install torch==1.0.1 -f https://download.pytorch.org/whl/cu80/stable # CUDA 8.0 build
pip install torch==1.0.1 -f https://download.pytorch.org/whl/cu90/stable # CUDA 9.0 build
pip install torch==1.0.1 -f https://download.pytorch.org/whl/cu92/stable # CUDA 9.2 build
pip install torch==1.0.1 -f https://download.pytorch.org/whl/cu100/stable # CUDA 10.0 build

Note: most pytorch versions are available only for specific CUDA versions. For example pytorch=1.0.1 is not available for CUDA 9.2

(Old) PyTorch Linux binaries compiled with CUDA 7.5

These predate the mechanism above with pip install -f and have to be manually installed by downloading the wheel file and pip install downloaded_file

Windows binaries

Mac and misc. binaries

For recent macOS binaries, use conda:

e.g.,

conda install pytorch=0.4.1 cuda90 -c pytorch conda install pytorch=0.4.1 cuda92 -c pytorch conda install pytorch=0.4.1 cuda80 -c pytorch conda install pytorch=0.4.1 -c pytorch # No CUDA