先在终端中输入命令添加清华源如下:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
然后安装0.4.1的pytorch,输入命令:
conda install pytorch-cpu=0.4.1 -c pytorch
conda install torchvision-cpu -c pytorch
pytorch就安装好了,然后通过以下代码验证:
python
import torch
import torchvision