在浴室里做的网站,网站总体规划设计说明,无障碍网站建设的摘要,门户网站建设工作流程mmdetection配置最重要的是版本匹配#xff0c;特别是cuda#xff0c;torch与mmcv-full 本项目以mmdetection v2.28.2为例介绍
1.查看显卡算力
因为gpu的算力需要与Pytorch依赖的CUDA算力匹配#xff0c;低版本GPU可在相对高的CUDA版本下运行#xff0c;相反则不行
算力…mmdetection配置最重要的是版本匹配特别是cudatorch与mmcv-full 本项目以mmdetection v2.28.2为例介绍
1.查看显卡算力
因为gpu的算力需要与Pytorch依赖的CUDA算力匹配低版本GPU可在相对高的CUDA版本下运行相反则不行
算力不匹配运行torch训练会报如下错误
CUDA error: no kernel image is available for execution on the device torch和cuda适配信息参考链接
我们用的显卡是A40和4080其中4080算力8.9A40算力8.6
2. cuda安装 根据显卡算力cuda选择用11.6版本
下载链接
添加权限
chmod 700 cuda_11.6.0_510.39.01_linux.run
安装
sh chmod 700 cuda_11.6.0_510.39.01_linux.run
注意要将driver取消即按空格显示不执行即可 3.安装对应版本的torch1.13.0
参考链接
pip install torch1.13.0cu116 torchvision0.14.0cu116 torchaudio0.13.0 --extra-index-url https://download.pytorch.org/whl/cu116
ps可以通过如下命令查看torch与cuda算力是否匹配 import torch
torch.cuda.get_arch_list()torch.cuda.get_arch_list()
[sm_37, sm_50, sm_60, sm_70, sm_75, sm_80, sm_86]torch.__version__
1.13.0cu116
torch1.13.0cu116可支持sm_86在A40和4080上都可以运行 4.下载安装mmdetection
参考链接
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -v -e . -i https://pypi.tuna.tsinghua.edu.cn/simple
5. 下载安装mmcv-full参考链接
pip install mmcv-full1.7.1 -f https://download.openmmlab.com/mmcv/dist/cu116/torch1.13.0/index.html
ps:
mmcv和mmcv-full只需要安装一个即可两个都安装会报各种module找不到错误 mmcv-full最高只有1.7.1版本且不支持torch1.13.1torch2.0对应mmcv没有mmcv-full了 对于本篇博客配置的mmdetection来说安装mmcv会报找不到runner错误 参考链接yolov5训练加速--一个可能忽视的细节mmdetection也一样为什么显卡使用率老是为0_kv1830的博客-CSDN博客
解决CUDA error: no kernel image is available for execution on the device-CSDN博客
pytorch 报错 RuntimeError: CUDA error: no kernel image is available for execution on the device_可豌豆的博客-CSDN博客