各版本Pytorch安装详解

Pytorch安装教程

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

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

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
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值