1.配置镜像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
2.安装Pytorch
进入官网
执行command
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
如果感觉以上仍然很慢,可以尝试用pip工具安装
pip install torch torchvision -i https://pypi.tuna.tsinghua.edu.cn/simple
出现下面这个字样表示安装成功