一、首先下載安裝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官網的源,而不是清華的,速度依然非常慢
五、驗證是否安裝成功