Pytorch installation and environment configuration

https://pytorch.org/get-started/previous-versions/

https://blog.csdn.net/thomaswu1992/article/details/90293015

Use conda to install, first create pytorch's virtual environment pytorch-py36 before installation, python chooses version 3.6

 

Then activate pytorch-py36 in the Anaconda prompt to enter this environment, copy the following code into it, and press Enter to install.

conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch

 Finally, in the pytorch-py36 environment, enter python and enter the following code to test the installation

import torch   # 导入torch包 如果没有报错则表示安装成功
torch.cuda.is_available()  # 返回True则表示GPU可用, 反之则不可用

Because CUDA9.0 and the corresponding version of cuDNN were installed when tensorflow was installed before, this installation of Pytorch did not involve downloading CUDA and cuDNN from the NVIDIA official website.

However, during the installation, I downloaded a hundreds of megabytes of cudatoolkit 9.0.

Guess you like

Origin blog.csdn.net/ch206265/article/details/106916693