Accuracy issue with int8_mobilenet_ssd tester
In the mobilenetssd INT8 unit test test_analyzer_int8_object_detection.cc, to compare the result, the test used CompareQuantizeAndAnalysisResult in test_helper.cc used ComputeTopAccuracy function while mAP should be read out through second element of the result vector.
There is accuracy drop after changing to mAP comparison. We are investigating it @wojtuss .
The ComputeTopAccuracy method used in the test compares the second output elements which are current mAP values. A fix will be to compare the third output elements: cumulative mAP.
After this fix, the warmup batch size has to be modified. With the current value of 100 the test fails with big accuracy difference. The best accuracy is obtained (on SKX) with warmup batch size 9:
FP32: avg top1 accuracy: 0.7386
INT8: avg top1 accuracy: 0.7310
I just want to correct that the result 0.7386 is not avg top1 but top5 which is referred as accumulative map . Top 1 is around 0.83.
@wzzju @luotao1
Command line:
paddle/fluid/inference/tests/api/test_analyzer_int8_object_detection "ARGS" "--infer_model=third_party/inference_demo/int8v2/mobilenet-ssd/model" "--infer_data=/home/bingyang/.cache/paddle/dataset/pascalvoc/pascalvoc_full.bin" "--warmup_batch_size=10" "--batch_size=100" "--paddle_num_threads=1"
- On Cascade Lake (New Machine) Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz:
I0814 20:39:33.458715 375748 tester_helper.h:468] --- Performance summary ---
I0814 20:39:33.458737 375748 tester_helper.h:469] FP32: avg fps: 52.8032, avg latency: 18.9383 ms
I0814 20:39:33.458747 375748 tester_helper.h:472] INT8: avg fps: 159.3869, avg latency: 6.2740 ms
I0814 20:39:33.458755 375748 tester_helper.h:452] --- Accuracy summary ---
I0814 20:39:33.458760 375748 tester_helper.h:453] Accepted mAP drop threshold: 0.01. (condition: (FP32_mAP - INT8_mAP ) <= threshold)
I0814 20:39:33.458765 375748 tester_helper.h:457] FP32: avg mAP 0.7380
I0814 20:39:33.458768 375748 tester_helper.h:459] INT8: avg mAP 0.7291
- On Skylake (old machine) Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz:
I0814 17:46:16.489825 1646 tester_helper.h:468] --- Performance summary ---
I0814 17:46:16.489841 1646 tester_helper.h:469] FP32: avg fps: 45.7208, avg latency: 21.8719 ms
I0814 17:46:16.489859 1646 tester_helper.h:472] INT8: avg fps: 81.6199, avg latency: 12.2519 ms
I0814 17:46:16.489867 1646 tester_helper.h:452] --- Accuracy summary ---
I0814 17:46:16.489869 1646 tester_helper.h:453] Accepted mAP drop threshold: 0.01. (condition: (FP32_mAP - INT8_mAP ) <= threshold)
I0814 17:46:16.489873 1646 tester_helper.h:457] FP32: avg mAP 0.7380
I0814 17:46:16.489876 1646 tester_helper.h:459] INT8: avg mAP 0.7303
I just want to correct that the result 0.7386 is not avg top1 but top5 which is referred as accumulative map . Top 1 is around 0.83.
I cannot understand this sentence. 0.7386 is not avg top1 but top5, and top 1 is around 0.83? top1 is higher than top5?
This has been fixed.