步骤一:添加清华镜像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
步骤二:设置搜索时显示通道地址,执行下面命令
conda config --set show_channel_urls yes
步骤三:执行pytorch命令
conda install pytorch torchvision cpuonly
要是conda安装还是慢挂了,就尝试使用pip来安装
Package上面选择:Pip即可
pip install torch===1.6.0 torchvision===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
【注意】把-c pytorch去掉
命令最后是-c pytorch
,默认还是从conda源下载,新安装的清华等源没有用上。