Open dengxinlong opened 3 years ago
@dengxinlong 你将use_calib_mode 设为False再测试下呢,use_calib_mode只在trt离线量化才会有效,否则会影响预测速度,这个问题在develop分支的代码下修复了:https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.0/static/deploy/python/infer.py#L420
@dengxinlong 你将use_calib_mode 设为False再测试下呢,use_calib_mode只在trt离线量化才会有效,否则会影响预测速度,这个问题在develop分支的代码下修复了:https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.0/static/deploy/python/infer.py#L420
我重新测试例一下,这里使用的是前几天刚clone下来的PaddleDetection release 2.0版本代码,使用static/deploy/python/infer.py来推理,使用的模型就是训练好的ssdlite_mobilenet_v3_large_fpn,没有经过感知量化,就是tools/train.py训练好的模型。 说明:测试2226张图片,统计总的时间,然后计算均值,也就是每张图片推理大约需要多少时间。 trt_int8: 29.82ms trt_fp16: 26.64ms trt_fp32: 27.58ms 想请教的问题: 效果还是反向的??
使用了static/deploy/python/infer.py 不过使用的是static下的。推理模型是ssdlite_mobilenet_v3。 说明:推理的模型是经过感知量化训练之后的。但是,没有经过感知量化训练的模型我也测试了,数值有差别,但是trt_int8的推理时间仍然比不使用trt_int8更长。 运行输出:
上面是trt_fp16,但模型是经过感知量化之后的。
下面是trt_int8的输出:
trt_fp16的推理时间为57.6ms,而trt_int8的推理时间为30000多ms,这实在不合理啊。 问题:
两者差别太大,并且我的模型是经过感知量化之后的,为什么? 在对模型训练完之后,使用tools/eval.py进行评估的时候,fps在30多,但这里推理的时间是不是太长了,不管是哪种方式,是不是计算方式不一致? 环境:jetson xavier nx,测试模型:ssdlite-mobilenetv3_large_fpn,数据集:自定义数据集