第一步
切换Anaconda下载源。
# 添加清华源
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源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
# for legacy win-64
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/
第二步
复制PyTorch官网命令,并将 -c pytorch删除。
-c pytorch是强制从PyTorch官网下载包,配置的清华源就会失效。
#conda install pytorch torchvision cudatoolkit=10.0 -c pytorch 官网源命令
conda install pytorch torchvision cudatoolkit=10.0