YOLOv6 icon indicating copy to clipboard operation
YOLOv6 copied to clipboard

得到 TensorRT 模型后,评估其性能出现错误'Results do not correspond to current coco set'

Open Superwen1017 opened this issue 2 years ago • 2 comments

Before Asking

  • [X] I have read the README carefully. 我已经仔细阅读了README上的操作指引。

  • [X] I want to train my custom dataset, and I have read the tutorials for training your custom data carefully and organize my dataset correctly; (FYI: We recommand you to apply the config files of xx_finetune.py.) 我想训练自定义数据集,我已经仔细阅读了训练自定义数据的教程,以及按照正确的目录结构存放数据集。(FYI: 我们推荐使用xx_finetune.py等配置文件训练自定义数据集。)

  • [X] I have pulled the latest code of main branch to run again and the problem still existed. 我已经拉取了主分支上最新的代码,重新运行之后,问题仍不能解决。

Search before asking

  • [X] I have searched the YOLOv6 issues and found no similar questions.

Question

当我们得到 TensorRT 模型后,我们可以通过以下方式评估其性能:python deploy/ONNX/eval_trt.py --weights yolov6s.engine --batch-size=1 --data data/coco.yaml 当我用tensorrt进行推理时,测试性能时会出现错误'Results do not correspond to current coco set' set(annsImgIds) == (set(annsImgIds) & set(self.getImgIds()))
这句话出现了问题,annsImgIds 数量和self.getImgIds()数量不相等且格式不一样。我没有动过源代码,这是怎么回事呢?谢谢!

Additional

No response

Superwen1017 avatar May 11 '23 10:05 Superwen1017

如果是 coco 数据集,评估的时候有个参数 --is_coco 您加上这个参数了吗?

mtjhl avatar May 15 '23 07:05 mtjhl

我也遇到了相同的错误,我的推测如下:

https://github.com/meituan/YOLOv6/blob/55d80c317edd0fb5847e599a1802d394f34a3141/yolov6/core/evaler.py#L491

这里,当文件名为数字时,可能导致 id 的类型被错误转换。

image_id = path.stem

用上述代码替换后,eval_trt.py 可以正常执行。

wuxianucw avatar Sep 01 '23 17:09 wuxianucw