如何下载pytorch的历史版本?

举报
AI浩 发表于 2021/12/23 02:20:30 2021/12/23
【摘要】 网页地址:https://pytorch.org/get-started/previous-versions/ INSTALLING PREVIOUS VERSIONS OF PYTORCH We’d prefer you install the latest version, but old binaries and i...

网页地址:https://pytorch.org/get-started/previous-versions/

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.

COMMANDS FOR VERSIONS >= 1.0.0

v1.6.0

Conda

OSX


  
  1. # conda
  2. conda install pytorch==1.6.0 torchvision==0.7.0 -c pytorch

Linux and Windows


  
  1. # CUDA 9.2
  2. conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=9.2 -c pytorch
  3. # CUDA 10.1
  4. conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.1 -c pytorch
  5. # CUDA 10.2
  6. conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.2 -c pytorch
  7. # CPU Only
  8. conda install pytorch==1.6.0 torchvision==0.7.0 cpuonly -c pytorch

Wheel

OSX

pip install torch==1.6.0 torchvision==0.7.0

 

Linux and Windows


  
  1. # CUDA 10.2
  2. pip install torch==1.6.0 torchvision==0.7.0
  3. # CUDA 10.1
  4. pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
  5. # CUDA 9.2
  6. pip install torch==1.6.0+cu92 torchvision==0.7.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html
  7. # CPU only
  8. pip install torch==1.6.0+cpu torchvision==0.7.0+cpu -f https://download.pytorch.org/whl/torch_stable.html

v1.5.1

Conda

OSX


  
  1. # conda
  2. conda install pytorch==1.5.1 torchvision==0.6.1 -c pytorch

Linux and Windows


  
  1. # CUDA 9.2
  2. conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=9.2 -c pytorch
  3. # CUDA 10.1
  4. conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=10.1 -c pytorch
  5. # CUDA 10.2
  6. conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=10.2 -c pytorch
  7. # CPU Only
  8. conda install pytorch==1.5.1 torchvision==0.6.1 cpuonly -c pytorch

Wheel

OSX

pip install torch==1.5.1 torchvision==0.6.1

 

Linux and Windows


  
  1. # CUDA 10.2
  2. pip install torch==1.5.1 torchvision==0.6.1
  3. # CUDA 10.1
  4. pip install torch==1.5.1+cu101 torchvision==0.6.1+cu101 -f https://download.pytorch.org/whl/torch_stable.html
  5. # CUDA 9.2
  6. pip install torch==1.5.1+cu92 torchvision==0.6.1+cu92 -f https://download.pytorch.org/whl/torch_stable.html
  7. # CPU only
  8. pip install torch==1.5.1+cpu torchvision==0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

v1.5.0

Conda

OSX


  
  1. # conda
  2. conda install pytorch==1.5.0 torchvision==0.6.0 -c pytorch

Linux and Windows


  
  1. # CUDA 9.2
  2. conda install pytorch==1.5.0 torchvision==0.6.0 cudatoolkit=9.2 -c pytorch
  3. # CUDA 10.1
  4. conda install pytorch==1.5.0 torchvision==0.6.0 cudatoolkit=10.1 -c pytorch
  5. # CUDA 10.2
  6. conda install pytorch==1.5.0 torchvision==0.6.0 cudatoolkit=10.2 -c pytorch
  7. # CPU Only
  8. conda install pytorch==1.5.0 torchvision==0.6.0 cpuonly -c pytorch

Wheel

OSX

pip install torch==1.5.0 torchvision==0.6.0

 

Linux and Windows


  
  1. # CUDA 10.2
  2. pip install torch==1.5.0 torchvision==0.6.0
  3. # CUDA 10.1
  4. pip install torch==1.5.0+cu101 torchvision==0.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
  5. # CUDA 9.2
  6. pip install torch==1.5.0+cu92 torchvision==0.6.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html
  7. # CPU only
  8. pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html

v1.4.0

Conda

OSX


  
  1. # conda
  2. conda install pytorch==1.4.0 torchvision==0.5.0 -c pytorch

Linux and Windows


  
  1. # CUDA 9.2
  2. conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=9.2 -c pytorch
  3. # CUDA 10.1
  4. conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=10.1 -c pytorch
  5. # CPU Only
  6. conda install pytorch==1.4.0 torchvision==0.5.0 cpuonly -c pytorch

Wheel

OSX

pip install torch==1.4.0 torchvision==0.5.0

 

Linux and Windows


  
  1. # CUDA 10.1
  2. pip install torch==1.4.0 torchvision==0.5.0
  3. # CUDA 9.2
  4. pip install torch==1.4.0+cu92 torchvision==0.5.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html
  5. # CPU only
  6. pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html

v1.2.0

Conda

OSX


  
  1. # conda
  2. conda install pytorch==1.2.0 torchvision==0.4.0 -c pytorch

Linux and Windows


  
  1. # CUDA 9.2
  2. conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=9.2 -c pytorch
  3. # CUDA 10.0
  4. conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0 -c pytorch
  5. # CPU Only
  6. conda install pytorch==1.2.0 torchvision==0.4.0 cpuonly -c pytorch

Wheel

OSX

pip install torch==1.2.0 torchvision==0.4.0

 

Linux and Windows


  
  1. # CUDA 10.0
  2. pip install torch==1.2.0 torchvision==0.4.0
  3. # CUDA 9.2
  4. pip install torch==1.2.0+cu92 torchvision==0.4.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html
  5. # CPU only
  6. pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html

v1.1.0

Conda

OSX


  
  1. # conda
  2. conda install pytorch==1.1.0 torchvision==0.3.0 -c pytorch

Linux and Windows


  
  1. # CUDA 9.0
  2. conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch
  3. # CUDA 10.0
  4. conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=10.0 -c pytorch
  5. # CPU Only
  6. conda install pytorch-cpu==1.1.0 torchvision-cpu==0.3.0 cpuonly -c pytorch

Wheel

OSX

pip install torch==1.1.0 torchvision==0.3.0

 

Linux and Windows


  
  1. # CUDA 10.0
  2. Download and install wheel from https://download.pytorch.org/whl/cu100/torch_stable.html
  3. # CUDA 9.0
  4. Download and install wheel from https://download.pytorch.org/whl/cu90/torch_stable.html
  5. # CPU only
  6. Download and install wheel from https://download.pytorch.org/whl/cpu/torch_stable.html

v1.0.1

Conda

OSX


  
  1. # conda
  2. conda install pytorch==1.0.1 torchvision==0.2.2 -c pytorch

Linux and Windows


  
  1. # CUDA 9.0
  2. conda install pytorch==1.0.1 torchvision==0.2.2 cudatoolkit=9.0 -c pytorch
  3. # CUDA 10.0
  4. conda install pytorch==1.0.1 torchvision==0.2.2 cudatoolkit=10.0 -c pytorch
  5. # CPU Only
  6. conda install pytorch-cpu==1.0.1 torchvision-cpu==0.2.2 cpuonly -c pytorch

Wheel

OSX

pip install torch==1.0.1 torchvision==0.2.2

 

Linux and Windows


  
  1. # CUDA 10.0
  2. Download and install wheel from https://download.pytorch.org/whl/cu100/torch_stable.html
  3. # CUDA 9.0
  4. Download and install wheel from https://download.pytorch.org/whl/cu90/torch_stable.html
  5. # CPU only
  6. Download and install wheel from https://download.pytorch.org/whl/cpu/torch_stable.html

v1.0.0

Conda

OSX


  
  1. # conda
  2. conda install pytorch==1.0.0 torchvision==0.2.1 -c pytorch

Linux and Windows


  
  1. # CUDA 10.0
  2. conda install pytorch==1.0.0 torchvision==0.2.1 cuda100 -c pytorch
  3. # CUDA 9.0
  4. conda install pytorch==1.0.0 torchvision==0.2.1 cuda90 -c pytorch
  5. # CUDA 8.0
  6. conda install pytorch==1.0.0 torchvision==0.2.1 cuda80 -c pytorch
  7. # CPU Only
  8. conda install pytorch-cpu==1.0.0 torchvision-cpu==0.2.1 cpuonly -c pytorch

Wheel

OSX

pip install torch==1.0.0 torchvision==0.2.1

 

Linux and Windows


  
  1. # CUDA 10.0
  2. Download and install wheel from https://download.pytorch.org/whl/cu100/torch_stable.html
  3. # CUDA 9.0
  4. Download and install wheel from https://download.pytorch.org/whl/cu90/torch_stable.html
  5. # CUDA 8.0
  6. Download and install wheel from https://download.pytorch.org/whl/cu80/torch_stable.html
  7. # CPU only
  8. Download and install wheel from https://download.pytorch.org/whl/cpu/torch_stable.html

COMMANDS FOR VERSIONS < 1.0.0

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 from the following html pages:

Then, install the file with pip install [downloaded file]

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 html page above 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

文章来源: wanghao.blog.csdn.net,作者:AI浩,版权归原作者所有,如需转载,请联系作者。

原文链接:wanghao.blog.csdn.net/article/details/112762997

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。