anaconda prompt查看cuda版本:
nvidia-smi
查看PyTorch中torch、torchvision、torchaudio版本对应关系https://github.com/pytorch/vision#installationhttps://github.com/pytorch/vision#installation
下载对应的torch和torchvision,网站中cu**表示对应的cuda版本,cp表示python版本
download.pytorch.org/whl/torch_stable.htmlhttps://download.pytorch.org/whl/torch_stable.html
下载完对应的版本后,保存,在anaconda prompt中打开对应路径,执行命令(两个都要pip):
pip install *** #下载的文件全名
查看是否安装上,执行命令
pip list
若出现那么就安装上了。下面检查安装情况,执行命令:
import torch
print(torch.__version__)
print(torch.cuda.is_available())
成功