使用默认conda源或者pip源安装PyTorch时,经常会下载很慢,这里我是用上海交大的pytorch-wheels源来进行加速。
pytorch-wheels 是 PyTorch pip 源的镜像。直接将 PyTorch 安装指引 中的 https://download.pytorch.org/whl 替换为 https://mirror.sjtu.edu.cn/pytorch-wheels 即可。
使用前最好先把pip镜像源也设置一下
pip config set global.index-url https://mirrors.cernet.edu.cn/pypi/web/simple
这里提供几个版本的PyTorch对应的安装命令
# latest+cu118
pip install torch torchvision torchaudio -f https://mirror.sjtu.edu.cn/pytorch-wheels/cu118
# latest+cu121
pip install torch torchvision torchaudio -f https://mirror.sjtu.edu.cn/pytorch-wheels/cu121
# 2.3.0+cu118
pip install torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 -f https://mirror.sjtu.edu.cn/pytorch-wheels/cu118
# 2.3.0+cu121
pip install torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 -f https://mirror.sjtu.edu.cn/pytorch-wheels/cu121
# 2.2.0+cu118
pip install torch==2.2.0 torchvision==0.17.0 torchaudio==2.2.0 -f https://mirror.sjtu.edu.cn/pytorch-wheels/cu118
# 2.2.0+cu121
pip install torch==2.2.0 torchvision==0.17.0 torchaudio==2.2.0 -f https://mirror.sjtu.edu.cn/pytorch-wheels/cu121
# 2.1.0+cu118
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 -f https://mirror.sjtu.edu.cn/pytorch-wheels/cu118
# 2.1.0+cu121
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 -f https://mirror.sjtu.edu.cn/pytorch-wheels/cu121
# 2.0.0+cu118
pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 -f https://mirror.sjtu.edu.cn/pytorch-wheels/cu118
没有回复内容