torch的cuda版本安装
1.拥有英伟达显卡NVIDIA
NVIDIA CUDA各版本下载链接(包括最新11版本和以往10.2版本)
以下是从NVIDIA官网转过来的链接,方便需要下载各种版本CUDA的同学。(借阅)
https://blog.csdn.net/weixin_44177494/article/details/120444922?spm=1001.2014.3001.5502
例:https://developer.nvidia.com/cuda-downloads
https://developer.nvidia.com/cuda-11-4-1-download-archive
pytorch安装https://pytorch.org/get-started/locally/
annaconda安装https://www.anaconda.com/download/
2.查看自己的cuda版本
3.cmd安装cuda环境
选择对应的框复制下面的代码在命令框中输入
4.进入网页下载cuda版本的torch库
https://download.pytorch.org/whl/torch/
例如:
5.安装库
6.进行测试
1 import torch 2 print(torch.__version__) 3 print(torch.device(type="cuda",index=1)) 4 print("是否使用GPU训练:{}".format(torch.cuda.is_available()))
当显示为True则已配置成功