Open Rax-Lie opened 7 months ago
Hi @Rax-Lie
Thanks for reaching out. There are two issues here:
1) 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
user guide: https://quic.github.io/aimet-pages/releases/latest/user_guide/quantization_sim.html example notebook: https://quic.github.io/aimet-pages/releases/latest/Examples/torch/quantization/qat.html
2) 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. https://github.com/quic/aimet/pull/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:
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: