Megvii-BaseDetection / YOLOX

YOLOX is a high-performance anchor-free YOLO, exceeding yolov3~v5 with MegEngine, ONNX, TensorRT, ncnn, and OpenVINO supported. Documentation: https://yolox.readthedocs.io/
Apache License 2.0
9.41k stars 2.21k forks source link

nano infer time is too long #310

Closed EdwardVincentMa closed 3 years ago

EdwardVincentMa commented 3 years ago

python tools/demo.py image --conf 0.25 --nms 0.45 --tsize 736 --save_result --device [gpu]

用的 yolox-nano模型,输入图像736,速度0.36秒左右,这速度不太可能啊,很慢很慢,这demo命令没错吧,用的是gpu。之前别的模型,cpu跑infer才50ms,这个是不是哪里出错了,太离谱了。

GOATmessi8 commented 3 years ago

yolox-nano is designed for arm devices (DW conv). If you wanna test yolox on GPU or NPU, yolox-tiny may be a better choice. Meanwhile, plz follow the speed testing guide and use eval.py to get a precise AVG latency.

EdwardVincentMa commented 3 years ago

yolox-nano is designed for arm devices (DW conv). If you wanna test yolox on GPU or NPU, yolox-tiny may be a better choice. Meanwhile, plz follow the speed testing guide and use eval.py to get a precise AVG latency.

大佬您好,我找到原因了,应该是用了cpu而不是gpu。

  1. dw conv 在gpu上速度是很快的;
  2. 我把命令改成:--device [cpu],与 gpu 结果一致。这么慢的速度应该是用了cpu了。
  3. 我试了tiny,速度是0.23秒,速度是快了50%,但也很慢,3070上,输入736怎么也能跑个100帧才对,只有5帧这个肯定有问题。