PyTorch官网
官网下载比较慢
添加清华镜像源:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
查看添加镜像源:
conda config --set show_channel_urls yes | cat ~/.condarc
显示
如上则添加成功
去PyTorch官网选择适合版本的shell脚本
不要复制 -c pytorch即可采用清华镜像源下载,否则采用官网源下载。
等待安装成功即可。
以上可能会出错,则将https改为http,重新添加源即可
# 删除已添加的源
conda config --remove-key channels