1 换成清华源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
2 还原初始源
conda config --remove-key channels
3 Conda 附加库
3.1 pytorch库
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud//pytorch/
注意:
ch 官网给的安装命令需要去掉最后的 -c pytorch ,这样才能享受清华源的高速。
即 conda install pytorch torchvision torchaudio cudatoolkit=11.0 -c pytorch
去掉最后的-c pytorch
4 修改最大下载时间
当因为网速过慢,导致系统自动中断下载时,可以设置最大下载时间:
conda config --set remote_read_timeout_secs 600.0
600表示10分钟,可以根据需要更改
5 离线下载安装
如果conda在线下载一直失败(网速太慢),可以先去清华源下载.bz
文件:
url: https://repo.anaconda.com/pkgs/main/linux-64/cudnn-7.0.5-cuda8.0_0.tar.bz2
然后离线安装这个包:
conda install --offline ./cudnn-7.0.5-cuda8.0_0.tar.bz2