添加清华anaconda镜像:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
.condarc 文件(在home/用户名/下),删除里面的 defaults
pytorch
/pytorch/
conda-forge
/conda-forge/
msys2
/msys2/
bioconda
/bioconda/
menpo
/menpo/
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
最好使用指定源的方式安装:conda install --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ pytorch torchvision cudatoolkit=10.2 -c pytorch
--show-sources #查看当前使用源