Pytorch 安装教程

前期环境

win7 64位

anaconda3.4.1

cuda9.0

1、进入pytorch官网(https://pytorch.org),根据自己的配置选择,如下图所示,然后打开dos窗口,在窗口中依次输入如下命令:

pip3 install http://download.pytorch.org/whl/cu90/torch-0.4.0-cp35-cp35m-win_amd64.whl 

pip3 install torchvision

 

 

2、输入第一条命令后会提示正在下载所需的包,等待下载完成即可

全部下载完后后,如果提示Successfully installed torch-0.4.0,则输入下一条命令:

pip3 install torchvision

 

3、执行完后提示Successfully installed pillow-5.2.0 torchvision-0.2.1,即安装完毕。

 

4、检查是否安装好pytorch,torchvision和pytorch是否支持cuda,先在dos窗口中输入Python,然后:

输入如下命令:

>>import torch

>>import torchvision

>>print(torch.cuda.is_available())

如果输出为True,则证明已经配置成功。

 

猜你喜欢

转载自blog.csdn.net/AAlonso/article/details/81503766