conda install pytorch torchvision cudatoolkit=10.0 -c pytorch
conda install pytorch torchvision cudatoolkit=8.0 -c pytorch
conda速度过于慢,因此可以使用pip3
#Python 3.5
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1-cp35-cp35m-win_amd64.whl
pip3 install torchvision
Python 3.6
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1-cp36-cp36m-win_amd64.whl
pip3 install torchvision
Python 3.7
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1-cp37-cp37m-win_amd64.whl
pip3 install torchvision
为了加速,使用一次性的源加速(以3.6为例)
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1-cp36-cp36m-win_amd64.whl -i http://mirrors.aliyun.com/pypi/simple/
pip3 install torchvision
查看pytorch版本
import torch
print(torch.version) verison两边都有双下划线
在虚拟环境的Scripts文件下,没有pip3.exe
因此,我们需要手动安装,在Scripts文件下打开cmd
输入easy_install.exe pip,即可安装成功,随后就可使用pip3命令