YOLOv6 icon indicating copy to clipboard operation
YOLOv6 copied to clipboard

qat训练模型的问题

Open dejavvuu opened this issue 2 years ago • 6 comments

  1. qat_export 中如何去掉量化反量化的算子
  2. qat_export 中qat_mAP比训练中量化的模型qat训练时的val map低,已经对比了各种参数,没找到map下降的原因 照理说是一样的模型权重

dejavvuu avatar Sep 22 '22 05:09 dejavvuu

@dejavvuu

  1. you can remove quant/de-quant ops from onnx graph before deployment.
  2. ~0.1 mAP drop is normal.

lippman1125 avatar Sep 28 '22 06:09 lippman1125

@dejavvuu

  1. you can remove quant/de-quant ops from onnx graph before deployment.
  2. ~0.1 mAP drop is normal.

我的意思是

  1. 应该有你们实现好的脚本,希望能提供
  2. 这个我认为是同样的权重,但map表现不同是为什么,能解释下吗

qat in train Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.896 Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.989 Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.966 Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.765 Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.884 Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.927 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.474 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.914 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.916 Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.802 Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.911 Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.945 qat _export Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.896 Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.985 Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.963 Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.748 Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.881 Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.931 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.476 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.913 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.914 Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.789 Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.910 Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.948

dejavvuu avatar Sep 29 '22 02:09 dejavvuu

可以提供相关脚本吗

dejavvuu avatar Oct 11 '22 08:10 dejavvuu

我也想问这个问题remove_qdq和sim是怎么操作的?有大佬知道吗?

aitangbodan avatar Oct 19 '22 08:10 aitangbodan

0.2.1版本中是怎么操作的,我转完trt后检测框不对,后来我在这里看个到了代码中关于remove_qdq的操作: https://github.com/meituan/YOLOv6/pull/653/commits/54deb7b233e322d9f57ba1c723b7013c53dd08eb#diff-0e63f33ad384f9d1c2694580813fca6e9fb69e5fae1b8e1c30e896e3484b8b2e 将该部分代码加入工程,然后检测框就正常了。

zahidzqj avatar Dec 22 '22 01:12 zahidzqj

在邊緣平台推論應該是要remove_qdq的onnx 對嗎 請問yolov6n_v2_reopt_qat_35.0_bs1_graph_opt_remove_qdq.sim.onnx 是否就是 remove_qdq的操作產出的? 有個.sim是否只是重新命名?

DrChungAlbert avatar Nov 25 '23 13:11 DrChungAlbert