maggiez0138 / yolov5_quant_sample

This is 8-bit quantization sample for yolov5. Both PTQ, QAT and Partial Quantization have been implemented, and present the results based on yolov5s.
GNU General Public License v3.0
97 stars 28 forks source link

Error while executing PTQ on Yolov5 model. #8

Closed vastech73 closed 2 years ago

vastech73 commented 2 years ago

I am trying to do evaluation on quantized model for yolov5. Followed the suggested steps and i am hitting this issue here. Looks like the cocoapi is not able to load the results file root@xhdr7525dcp5:/workspace/yolov5/yolov5_quant_sample# python trt/eval_yolo_trt.py --model weights/yolov5s-int8-16-16-minmax.trt --imgs-dir coco/images --annotations coco/annotations/instances_val2017.json weights/results_yolov5s-int8-16-16-minmax.json TRT model path: weights/yolov5s-int8-16-16-minmax.trt [11/15/2022-06:05:57] [TRT] [I] [MemUsageChange] Init CUDA: CPU +303, GPU +0, now: CPU 382, GPU 14101 (MiB) [11/15/2022-06:05:57] [TRT] [I] Loaded engine size: 9 MiB [11/15/2022-06:05:57] [TRT] [I] [MemUsageChange] TensorRT-managed allocation in engine deserialization: CPU +0, GPU +0, now: CPU 0, GPU 0 (MiB) [11/15/2022-06:05:57] [TRT] [I] [MemUsageChange] TensorRT-managed allocation in IExecutionContext creation: CPU +0, GPU +0, now: CPU 0, GPU 0 (MiB) loading annotations into memory... Done (t=0.45s) creating index... index created! Loading and preparing results... Traceback (most recent call last): File "trt/eval_yolo_trt.py", line 123, in main() File "trt/eval_yolo_trt.py", line 113, in main cocoDt = cocoGt.loadRes(results_file) File "/usr/local/lib/python3.8/dist-packages/pycocotools/coco.py", line 318, in loadRes if 'caption' in anns[0]: IndexError: list index out of range root@xhdr7525dcp5:/workspace/yolov5/yolov5_quant_sample#

vastech73 commented 2 years ago

Calibration directory was missing