TensorRT-CenterNet icon indicating copy to clipboard operation
TensorRT-CenterNet copied to clipboard

How to quantize model to int8?

Open liukaigua opened this issue 5 years ago • 4 comments

Hi, I notice that the ctdet_dlav0 model with int8 mode is reallly fast, so how do you transform fp32 to int8?Could you provide the model? Thanks.

liukaigua avatar Jan 03 '20 02:01 liukaigua

@lsccccc

  1. download ctdet_coco_dlav0_1x.pth from here.
  2. convert ctdet_coco_dlav0_1x.pth to ctdet_coco_dlav0_1x.onnx.
  3. build engine ./buildEngine -i ctdet_coco_dlav0_1x.onnx -o model/ctdet_coco_dlav0_1x.engine -m 2 -c calib_img_list.txt

CaoWGG avatar Jan 03 '20 03:01 CaoWGG

@CaoWGG Thank you, I will have a try.

liukaigua avatar Jan 03 '20 03:01 liukaigua

@CaoWGG Does the image in calib_img_list need to be preprocessed in the same way of CenterNet preprocess?

liukaigua avatar Jan 03 '20 03:01 liukaigua

@lsccccc You need to put the image path in *.txt. image preprocessing can refer to here.

CaoWGG avatar Jan 03 '20 04:01 CaoWGG