1. 前言
本文主要简要介绍Pytorch命令行安装教程~
2. windows版本
conda安装
1.cuda9.0 python3.6/3.5/3.7
conda install pytorch -c pytorch
pip3 install torchvision
2.cuda8.0 python3.6/3.5/3.7
conda install pytorch cuda80 -c pytorch
pip3 install torchvision
Pip安装
1.CUDA8.0 python3.5
pip3 install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp35-cp35m-win_amd64.whl
pip3 install torchvision
2.CUDA8.0 python3.6
pip3 install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp36-cp36m-win_amd64.whl
pip3 install torchvision
3.CUDA8.0 python3.7
pip3 install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp37-cp37m-win_amd64.whl
pip3 install torchvision
1.CUDA9.0 python3.7
pip3 install http://download.pytorch.org/whl/cu90/torch-0.4.1-cp37-cp37m-win_amd64.whl
pip3 install torchvision
2.CUDA9.0 python3.6
pip3 install http://download.pytorch.org/whl/cu90/torch-0.4.1-cp36-cp36m-win_amd64.whl
pip3 install torchvision
3.CUDA9.0 python3.5
pip3 install http://download.pytorch.org/whl/cu90/torch-0.4.1-cp35-cp35m-win_amd64.whl
pip3 install torchvision
1.CUDA9.2 python3.5
pip3 install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp35-cp35m-win_amd64.whl
pip3 install torchvision
2.CUDA9.2 python3.6
pip3 install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp36-cp36m-win_amd64.whl
pip3 install torchvision
3.CUDA9.2 python3.7
pip3 install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp37-cp37m-win_amd64.whl
pip3 install torchvision
1.没有CUDA python3.5
pip3 install http://download.pytorch.org/whl/cpu/torch-0.4.1-cp35-cp35m-win_amd64.whl
pip3 install torchvision
2.没有CUDA python3.6
pip3 install http://download.pytorch.org/whl/cpu/torch-0.4.1-cp36-cp36m-win_amd64.whl
pip3 install torchvision
3.没有CUDA python3.7
pip3 install http://download.pytorch.org/whl/cpu/torch-0.4.1-cp37-cp37m-win_amd64.whl
pip3 install torchvision
3. Linux安装
conda安装
1.cuda8.0 python3.5/3.6/3.7/2.7
conda install pytorch torchvision cuda80 -c pytorch
2.cuda9.0 python3.5/3.6/3.7/2.7
conda install pytorch torchvision -c pytorch
3.cuda9.0 python3.5/3.6/3.7/2.7
conda install pytorch torchvision cuda92 -c pytorch
pip安装
1.CUDA8.0 python2.7
pip install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp27-cp27mu-linux_x86_64.whl
pip install torchvision
#if the above command does not work, then you have python 2.7 UCS2, use this command
pip install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp27-cp27m-linux_x86_64.whl
2.CUDA8.0 python3.5
pip3 install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp35-cp35m-linux_x86_64.whl
pip3 install torchvision
3.CUDA8.0 python3.6
pip3 install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp36-cp36m-linux_x86_64.whl
pip3 install torchvision
4.CUDA8.0 python3.7
pip3 install http://download.pytorch.org/whl/cu80/torch-0.4.1.post2-cp37-cp37m-linux_x86_64.whl
pip3 install torchvision
1.CUDA9.0 python2.7
pip install torch torchvision
2.CUDA9.0 python3.5/3.6/3.7
pip3 install torch torchvision
1.CUDA9.2 python2.7
pip install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp27-cp27mu-linux_x86_64.whl
pip install torchvision
# if the above command does not work, then you have python 2.7 UCS2, use this command
pip install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp27-cp27m-linux_x86_64.whl
2.CUDA9.2 python3.5
pip3 install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp35-cp35m-linux_x86_64.whl
pip3 install torchvision
3.CUDA9.2 python3.6
pip3 install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp36-cp36m-linux_x86_64.whl
pip3 install torchvision
4.CUDA9.2 python3.7
pip3 install http://download.pytorch.org/whl/cu92/torch-0.4.1.post2-cp37-cp37m-linux_x86_64.whl
pip3 install torchvision
4. Mac安装
Conda安装
conda install pytorch torchvision -c pytorch
# MacOS Binaries dont support CUDA, install from source if CUDA is needed
Pip安装
1.python3.5/3.6/3.7
pip3 install torch torchvision
# MacOS Binaries dont support CUDA, install from source if CUDA is needed
2.python2.7
pip install torch torchvision
# MacOS Binaries dont support CUDA, install from source if CUDA is needed
cudn10版本等更多pytorch安装命令,请访问pytorch官网获得~
来源:CSDN
作者:算法之美DL
链接:https://blog.csdn.net/weixin_44222014/article/details/103499606