1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| $ cd ${workspace}/tengine_khadas_sdk/tengine_tools/quant_tool $ ./quant_tool_uint8 -m ../convert_tool/yolov3.tmfile -i ~/data/git/npu/datesets/tengine_test_datasets_100/ -o yolov3_u8.tmfile -g 3,416,416 -a MINMAX -w 0,0,0 -s 0.003922,0.003922,0.003922 -c 0 -t 4 -b 1 -y 416,416
---- Tengine Post Training Quantization Tool ----
Version : v1.2, 15:15:47 Jun 22 2021 Status : uint8, per-layer, asymmetric Input model : ../convert_tool/yolov3.tmfile Output model: yolov3_u8.tmfile Calib images: /home/yan/data/git/npu/datesets/tengine_test_datasets_100/ Scale file : NULL Algorithm : MIN MAX Dims : 3 416 416 Mean : 0.000 0.000 0.000 Scale : 0.004 0.004 0.004 BGR2RGB : ON Center crop : OFF Letter box : 416 416 YOLOv5 focus: OFF Thread num : 4
[Quant Tools Info]: Step 0, load FP32 tmfile. [Quant Tools Info]: Step 0, load FP32 tmfile done. [Quant Tools Info]: Step 0, load calibration image files. [Quant Tools Info]: Step 0, load calibration image files done, image num is 100. [Quant Tools Info]: Step 1, find original calibration table. [Quant Tools Info]: Step 1, images 00100 / 00100 [Quant Tools Info]: Step 1, find original calibration table done, output ./table_minmax.scale [Quant Tools Info]: Thread 4, image nums 100, total time 46397.79 ms, avg time 463.98 ms [Quant Tools Info]: Calibration file is using table_minmax.scale [Quant Tools Info]: Step 3, load FP32 tmfile once again [Quant Tools Info]: Step 3, load FP32 tmfile once again done. [Quant Tools Info]: Step 3, load calibration table file table_minmax.scale. [Quant Tools Info]: Step 4, optimize the calibration table. [Quant Tools Info]: Step 4, quantize activation tensor done. [Quant Tools Info]: Step 5, quantize weight tensor done. [Quant Tools Info]: Step 6, save Int8 tmfile done, yolov3_u8.tmfile
---- Tengine Int8 tmfile create success, best wish for your INT8 inference has a low accuracy loss...\(^0^)/ ----
|