torch 下载很慢,pip 安装github上的库很慢,改成http即可

torch cuda版本在清华源上没有,如果使用官方命令安装极慢

pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116

使用wget一样慢,只有几十kb每秒

wget https://download.pytorch.org/whl/cu116/torch-1.13.1%2Bcu116-cp37-cp37m-linux_x86_64.whl

只需要把https改为http,无需翻墙

pip3 install torch torchvision torchaudio --extra-index-url http://download.pytorch.org/whl/cu116

wget http://download.pytorch.org/whl/cu116/torch-1.13.1%2Bcu116-cp37-cp37m-linux_x86_64.whl
pip install torch-1.13.1+cu116-cp37-cp37m-linux_x86_64.whl.1

直接变成几十MB每秒,快的飞起

此方法在安装一些github的库时同样有效,把https://github.com/改为http://github.com/即可瞬间下载完成

猜你喜欢

转载自blog.csdn.net/qq_51750957/article/details/129473332