PaddleDetection icon indicating copy to clipboard operation
PaddleDetection copied to clipboard

用 RT-DETR 官方给出的推理代码推理完的结果置信度都低于0.1,导致预测无结果。

Open David-19940718 opened this issue 2 years ago • 8 comments

问题确认 Search before asking

  • [X] 我已经查询历史issue,没有发现相似的bug。I have searched the issues and found no similar bug report.

Bug组件 Bug Component

Inference

Bug描述 Describe the Bug

git clone 下来后,用官方示例的 infer 一张图片,置信度极低。

image

python tools/infer.py -c configs/rtdetr/rtdetr_r50vd_6x_coco.yml \
              -o weights=https://bj.bcebos.com/v1/paddledet/models/rtdetr_r50vd_6x_coco.pdparams \
              --infer_img bus.jpg \
              --save_results=True \
              --draw_threshold=0.5 \
              --visualize=True \
              --use_vdl=True

image

下面是日志:

image

复现环境 Environment

  • OS: Linux
  • PaddlePaddle: 2.4.2
  • PaddleDetection: develop
  • Python: 3.8.0
  • CUDA: 11.7
  • CUDNN: 7.6
  • GCC: 8.2.0

Bug描述确认 Bug description confirmation

  • [X] 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • [ ] 我愿意提交PR!I'd like to help by submitting a PR!

David-19940718 avatar Apr 26 '23 06:04 David-19940718

  • 同样的脚本和图片,并不能复现你说的问题(下面是推理保存的图片),,确保你代码和模型是最新的

python tools/infer.py -c configs/rtdetr/rtdetr_r50vd_6x_coco.yml -o weights=https://bj.bcebos.com/v1/paddledet/models/rtdetr_r50vd_6x_coco.pdparams --infer_img=bus.jpg image

image

lyuwenyu avatar Apr 26 '23 06:04 lyuwenyu

请问下我导出onnx推理后,得到一个300*6的矩阵,这6个值分别是[score, class, cx, cy, w, h]吗?你们那边有对应的后处理解析代码能提供下吗?我解析出来的框对不上。类别和置信度倒是对了。

image

David-19940718 avatar Apr 26 '23 06:04 David-19940718

  • 同样的脚本和图片,并不能复现你说的问题(下面是推理保存的图片),,确保你代码和模型是最新的

python tools/infer.py -c configs/rtdetr/rtdetr_r50vd_6x_coco.yml -o weights=https://bj.bcebos.com/v1/paddledet/models/rtdetr_r50vd_6x_coco.pdparams --infer_img=bus.jpg image

image

您好,我刚重新下载了最新的代码,还是一样得不到结果。请问这跟CUDNN版本不匹配有关系吗?

David-19940718 avatar Apr 26 '23 06:04 David-19940718

您好,我将绘制阈值调低到0.01,出来的结果是这样的:

bus

David-19940718 avatar Apr 26 '23 07:04 David-19940718

俺也一样,估计是cudnn版本的问题,还没解决

secrul avatar May 05 '23 07:05 secrul

好像就是cuda cudnn不匹配的问题。我重新装一下,cuda 11.3,cudnn 8.7,现在可以了。

secrul avatar May 06 '23 07:05 secrul

我有一样的问题,而且推理出的结果完全不对 CUDA 11.8, CUDNN 8.9, torch 2.1.0.dev20230425+cu118 soccer soccer

aliencaocao avatar May 12 '23 10:05 aliencaocao

如果自己导出模型做推理如ONNX,输入图像时要做像素值归一化操作(除以255),如果未做会出现类似推理置信度低的问题。

liang-stu avatar Mar 14 '24 08:03 liang-stu