一、首先下载安装anaconda,这里不多说,网上教程很多
二、换源,将pytorch换成清华的镜像,当然也可以是中科大等别的源,加快下载速度
镜像的网址为镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
三、把一些pytorch依赖包像如numpy、openssl等包的镜像也换成清华的
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
四、安装pytorch
1)、cpu版本安装
conda install pytorch-cpu torchvision-cpu #注意后面不要加上-c pytorch,否则用的依然是pytorch官网的源,而不是清华的,速度依然非常慢
五、验证是否安装成功