Python安装Cuda版的torch组件

图像生成 (2)_2026-03-20_21-03-00

官方安装指南:

https://pytorch.org/get-started/locally/

强制重装:

pip install --force-reinstall torch --index-url https://download.pytorch.org/whl/cu128
pip install -r requirements.txt --extra-index-url=https://download.pytorch.org/whl/cu118

其它镜像源:

https://mirror.sjtu.edu.cn/pytorch-wheels

#2.6+cu126

.\.env\python -m pip install  torch==2.6.0+cu126 torchvision==0.21.0 torchaudio==2.6.0+cu126 -i https://mirror.sjtu.edu.cn/pytorch-wheels

#2.7.0+cu126+xFormers 0.0.30

.\.ext\python -m pip install --upgrade torch==2.7.0+cu128 torchvision==0.23.0+cu128 torchaudio==2.7.0+cu128 xformers==0.0.30 -i https://mirror.sjtu.edu.cn/pytorch-wheels

#2.8.0+cu128

.\.ext\python -m pip install --upgrade torch==2.8.0+cu128 torchvision==0.23.0+cu128 torchaudio==2.8.0+cu128 xformers==0.0.32.post1 -i https://mirror.sjtu.edu.cn/pytorch-wheels

#2.9.1+cu130

.\.env\python -m pip install  torch==2.9.1+cu130 torchvision==0.21.0 torchaudio==2.9.1+cucu130 -i https://mirror.sjtu.edu.cn/pytorch-wheels

#2.3.1+cu121

.\.env\python -m pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 -i https://mirror.sjtu.edu.cn/pytorch-wheels/cu121

# 2.3.0+cu118
pip install torch==2.3.0+cu118 torchvision==0.18.0+cu118 torchaudio==2.3.0+cu118 -f https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html

# 2.3.0+cu121
pip install torch==2.3.0+cu121 torchvision==0.18.0+cu121 torchaudio==2.3.0+cu121 -f https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html

# 2.2.0+cu118
pip install torch==2.2.0+cu118 torchvision==0.17.0+cu118 torchaudio==2.2.0+cu118 -f https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html

# 2.2.0+cu121
pip install torch==2.2.0+cu121 torchvision==0.17.0+cu121 torchaudio==2.2.0+cu121 -f https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html

# 2.1.0+cu118
pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0+cu118 -f https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html

# 2.1.0+cu121
pip install torch==2.1.0+cu121 torchvision==0.16.0+cu121 torchaudio==2.1.0+cu121 -f https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html

# 2.0.0+cu118
pip install torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1+cu118 -f https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享