openvinotoolkit / nncf

Neural Network Compression Framework for enhanced OpenVINO™ inference
Apache License 2.0
934 stars 233 forks source link

Object Detection Quantization fails with OpenVINO 2024.3 #2889

Open fmishra747 opened 2 months ago

fmishra747 commented 2 months ago

🐛 Describe the bug

The yolov8 object detection quantization fails at File /lib/python3.10/site-packages/ultralytics/models/yolo/detect/val.py", line 183, in get_stats

**self.nt_per_image = np.bincount(stats["target_img"].astype(int), minlength=self.nc)

KeyError: 'target_img'** Complete log:

ov2024 (2).3_aa_obj_det.md

Environment

Yolov8 model with coco128 dataset Object Detection Quantization fails with OpenVINO 2024.3, "python_version": "3.10", nncf 2.13.0.dev0+eb91af2d ultralytics 8.2.74 ultralytics-thop 2.0.0 torch 2.4.0+cpu torchvision 0.19.0+cpu

The same application works fine with OpenVINO 2024.1 "python_version": "3.10", ultralytics 8.2.18 nncf 2.11.0.dev0+24f0ee70 torch 2.2.2+cpu torchvision 0.17.2+cpu

Minimal Reproducible Example

Execute object detection quantization python script after changing the extension from .md file quantize_accuracy_aware_object_detection_fullyworking.py.md with yolov8 and coco128 dataset

Are you going to submit a PR?

daniil-lyakhov commented 2 months ago

@fmishra747, your error log and the reproducer code does not match, please remove all unused сode and attach the reproducer as a text comment

MaximProshin commented 1 week ago

@fmishra747 , can you please provide the input requested above? Is still valid?