首先添加镜像源:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/free/
下面两行用上交源是因为上交源最近比清华源好用。
然后进官网:https://pytorch.org/get-started/locally/
复制命令并将命令删去 -c pytorch 即可自动从清华源下载安装包:
conda install pytorch torchvision cudatoolkit=10.0
这样速度就变快了!