# 换回默认源(清除所有用户添加的镜像源路径,只保留默认的路径) conda config --remove-key channels
# 显示所有镜像通道路径命令
conda config --show channels
conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/pkgs/main/ conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.bfsu.edu.cn/anaconda/cloud/pytorch/
conda create --name pt python=3.7
conda install pytorch torchvision torchaudio cudatoolkit=10.1
import torch print(torch.__version__) print("gpu:", torch.cuda.is_available())
原文:https://www.cnblogs.com/zhangxianrong/p/15061802.html