You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, Team,
I have been trying to quantify the YOLOv5 (v6.0) model using Aimet (1.27.0) recently, and I need to obtain encodings file to proceed with the next step of work. I received an error message from the Custom Marker:
TypeError: 'CustomMarker' object is not iterable
2024-01-24 17:18:04,539 - Utils - WARNING - naming of onnx op at non-leaf modules failed, skipping naming of non-leaf
2024-01-24 17:18:04,616 - Utils - INFO - successfully created onnx model with 245/309 node names updated
2024-01-24 17:18:04,811 - Quant - INFO - Layers excluded from quantization: []
Thanks for reaching out. There are two issues here:
Encodings JSON file is empty in your example because you have not performed "calibration" step and AIMET refers to it as compute_encodings. After creating QuantizationSimModel object, quantsim.model is still not ready to use yet. It only has added quantizer nodes to the model graph. To compute quantization parameters - scale/offset for all the weight and activation tensors of a model, we need to pass representative data through the quantsim.model. You can follow this notebook which shows an example of callback function which passes data through the model for compute_encodings step. Once you have computed encodings, you can export the model to ONNX format using quantsim.export() API
Regarding your TypeError: 'CustomMarker' object is not iterable, we released a fix for it sometime back which isn't part of AIMET 1.27 release I believe. You can either upgrade AIMET version to 1.30 (latest) or apply the patch. Add getitem for CustomMarker class #2548
Hope this helps. Please let us know if you have further questions.
Hi, Team,
I have been trying to quantify the YOLOv5 (v6.0) model using Aimet (1.27.0) recently, and I need to obtain encodings file to proceed with the next step of work. I received an error message from the Custom Marker:
TypeError: 'CustomMarker' object is not iterable 2024-01-24 17:18:04,539 - Utils - WARNING - naming of onnx op at non-leaf modules failed, skipping naming of non-leaf 2024-01-24 17:18:04,616 - Utils - INFO - successfully created onnx model with 245/309 node names updated 2024-01-24 17:18:04,811 - Quant - INFO - Layers excluded from quantization: []
Thre full logfile: yolov5.log
Here is mycode:
I followed the suggestion of #1067 but only obtained the converted ONNX model, but the corresponding encodings were empty. As follows:
yolov5.encodings
And my env as follows:
The text was updated successfully, but these errors were encountered: