pip 安装 pytorch-gpu 命令 cuda版本11.8
时间: 2024-06-10 08:06:40 浏览: 746
如何使用pip安装pytorch-gpu取决于您使用的操作系统和CUDA版本。如果您使用的是CUDA 11.1及以下版本,则可以使用以下命令安装适用于Python 3.8的torch和torchvision:
```
pip install torch torchvision torchaudio -f https://download.pytorch.org/whl/cu111/torch_stable.html
```
如果您的CUDA版本为11.2,则可以使用以下命令:
```
pip install torch torchvision torchaudio -f https://download.pytorch.org/whl/cu112/torch_stable.html
```
如果您的CUDA版本为11.3,则可以使用以下命令:
```
pip install torch torchvision torchaudio -f https://download.pytorch.org/whl/cu113/torch_stable.html
```
如果您的CUDA版本为11.4,则可以使用以下命令:
```
pip install torch torchvision torchaudio -f https://download.pytorch.org/whl/cu114/torch_stable.html
```
如果您的CUDA版本为11.6,则可以使用以下命令:
```
pip install torch torchvision torchaudio -f https://download.pytorch.org/whl/cu116/torch_stable.html
```
如果您的CUDA版本为11.8,则可以使用以下命令:
```
pip install torch torchvision torchaudio -f https://download.pytorch.org/whl/cu118/torch_stable.html
```
请注意,如果您使用的不是Python 3.8,则需要将上面的命令中的“3.8”替换为您正在使用的Python版本。另外,请确保已配置正确的CUDA环境变量和NVIDIA驱动程序,以便正确使用pytorch-gpu。
阅读全文
相关推荐


















