在CentOS上安装PyTorch GPU版,可按以下步骤进行:
sudo yum update -y
。pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117
(CUDA 11.7版本)。import torch; print(torch.__version__); print(torch.cuda.is_available())
,若输出显示版本号且cuda.is_available()
为True,则安装成功。