https://pytorch.org/官网可以根据操作系统,选择cuda版本, 和选择conda命令还是pip命令:
例如下载最新版本的pytorch命令为:
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu1132.pytorch历史版本下载
网址:https://pytorch.org/get-started/previous-versions/
3.下载完成后检测gpu是否可用代码:
import torch torch.cuda.is_available()
输出为ture表示gpu可用



