机器学习环境搭建
cuda
https://developer.nvidia.com/cuda-downloads
cudnn
将cudnn 解压拷贝到 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1 路径下 即可
pytorch 安装
https://pytorch.org/get-started/locally/
pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 // 去掉后缀 使用国内源即可
代码测试
(yolo) D:\>python
import torch
print(torch.__version__) #查看pytorch版本,如未安装Gpu版本,输出一般是torch版本+Cpu,如安装成功输出是torch版本+cuxxx,xxx表示cuda的版本号
print(torch.cuda.is_available()) #如输出是False说明未安装Gpu版本,cuda可用输出True
参考文献
posted on 2023-04-11 14:32 Indian_Mysore 阅读(44) 评论(2) 收藏 举报
浙公网安备 33010602011771号