docker部署ultralytics/yolov3 CUDA error: no kernel image is available for execution on the device

docker拉取ultralytics/yolov3最新版,调用显卡时显示CUDA error: no kernel image is available for execution on the device错误,一般是因为显卡算力、cuda版本、pytorch版本不兼容导致的。

我用的是rtx3090,算力8.6

nvcc --version命令查询cuda版本为Build cuda_11.4

运行yolov3时从提示中看到其使用的pytorch版本只兼容cuda10,所以升级pytorch就能解决问题。

pip install torch==1.10.1+cu111 torchvision==0.11.2+cu111 torchaudio==0.10.1 -f https://download.pytorch.org/whl/torch_stable.html

  

 判断显卡是否可用

import torch
print(torch.cuda.is_available())
posted @ 2022-06-22 09:35  盛世芳华  阅读(471)  评论(0编辑  收藏  举报