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.39k stars 2.2k forks source link

TensorRT-int8 model is NOT faster than TensorRT-float16 model #1001

Open KtechB opened 2 years ago

KtechB commented 2 years ago

I trained yolox-m model and convert it to TensorRT-int8 model with demo/trt.py. Difference from original trt.py is torch2trt's args , float16_mode=false and int8_mode=True, and calibration data [data].

 model_trt = torch2trt(
        model,
        [data],
        float16_mode=False,
        int8_mode=True,
        log_level=trt.Logger.INFO,
        max_workspace_size=(1 << args.workspace),
        max_batch_size=32,
        int8_calib_batch_size=32
    )

Infer times in tools/demo.py are like bellow.( Aws EC2 p3.2xlarge with Nvidia Tesla V100)

Other models( yolox-s, yolox-l) seems to be the same.
When using YOLOX, Int8 model is not faster than float model? Or I make some mistakes?

sahamitul commented 1 year ago

Hi @KtechB , did you solve this problem? How?