open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.7k stars 9.48k forks source link

About testing YOLOX model's FPS #6373

Closed sanmulab closed 3 years ago

sanmulab commented 3 years ago

作者你好!就是我用yolox训练模型,还没训练完,我用benchmark.py脚本测试模型的速度,发现只有35-40FPS左右,论文里不是有90FPS吗?还是说这个benchmark.py测试的FPS包括前向和后向推理,我应该乘以2吗?最后一个问题是,因为一些原因训练中断了,我用resume-from指令恢复训练,这样做有没有可能会影响模型AP指标。

hhaAndroid commented 3 years ago

@chensen668 We calculate FPS including network and post-processing. The official FPS needs to confirm whether the calculation methods on both sides are the same and resume does not cause a decrease in accuracy.

sanmulab commented 3 years ago

Thank you for your reply, so if I only keep forward processing for the model, can I make the about FPS*2?

sanmulab commented 3 years ago

Another problem is that I test FPS at the beginning, but it gets lower and lower later. Which should I take as the standard?

hhaAndroid commented 3 years ago
  1. You can test the forward FPS by excluding the get_bboxes function
  2. This is related to the dataset, because the box number of detection in each image is different, and the post-processing time is also different
sanmulab commented 3 years ago

Although I don't know how to do it, I'll try it. thank you

wywywy01 commented 2 years ago

去除get box,我在这个函数直接返回,类似于去掉后处理步骤,在yolox tiny上,减少2.5ms的时间; image

mmdet/models/dense_heads/yolox_head.py

另外,我自己测试速度 yolox tiny的速度,在3090上,速度如下,感觉很慢。去掉后处理,和不去掉后处理分别是 60fps和52fps image

sanmulab commented 2 years ago

去除get box,我在这个函数直接返回,类似于去掉后处理步骤,在yolox tiny上,减少2.5ms的时间; image

mmdet/models/dense_heads/yolox_head.py

另外,我自己测试速度 yolox tiny的速度,在3090上,速度如下,感觉很慢。去掉后处理,和不去掉后处理分别是 60fps和52fps image

操作就是把参数下面的代码注释掉,然后返回一个空数组是吗

sanmulab commented 2 years ago

去除get box,我在这个函数直接返回,类似于去掉后处理步骤,在yolox tiny上,减少2.5ms的时间; image

mmdet/models/dense_heads/yolox_head.py

另外,我自己测试速度 yolox tiny的速度,在3090上,速度如下,感觉很慢。去掉后处理,和不去掉后处理分别是 60fps和52fps image

操作就是把参数下面的代码注释掉,然后返回一个空数组是吗,还是直接在那一行加入retrun []

wywywy01 commented 2 years ago

我是这么做的,后处理部分基本就是减少2~3ms左右; 在论文原来的repo里面,也验证了这一点;

sanmulab commented 2 years ago

明白了,谢谢

我是这么做的,后处理部分基本就是减少2~3ms左右; 在论文原来的repo里面,也验证了这一点;

y72428026 commented 2 years ago

In the YOLOX paper, models are tested on V100 GPU. Different gpus may effect the testing fps?