解决pytorch安装因网速问题安装失败

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/cloud/conda-forge 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

2.在安装时本身已经切换到清华源,但是仍然在安装pytorch包的时候失败,这也是网络速度不行导致安装失败

这时可以考虑设置延时

参考https://blog.csdn.net/m0_37534550/article/details/88060501?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param

在执行安装命令之前可以使用

conda config --set remote_read_timeout_secs 1000.0

修改延时(conda 下载久了,会自动断开),800不行设置1000,1000不行设置1200进行尝试

 


版权声明:本文为ziqingnian原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。