-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when quantizing Yolov5 #1274
Comments
Hi @tucachmo2202 Thank you for reporting this. One way to debug this is to run the model validator to check if there are some updates needed to run quantization correctly : https://quic.github.io/aimet-pages/releases/1.21.0/api_docs/torch_model_validator.html#api-torch-model-validator. Prerequisites are captured here : https://quic.github.io/aimet-pages/releases/1.21.0/api_docs/torch_model_guidelines.html#api-torch-model-guidelines. After this, one could try model preparer to prepare the model for quantsim (example : perform auto replacement of functionals with nn modules etc) : https://quic.github.io/aimet-pages/releases/1.21.0/api_docs/torch_model_preparer.html#api-torch-model-preparer |
Hi @tucachmo2202 - Latest version of AIMET 1.23.0 should handle Yolov5. Please try it out. I would follow the example here and use AIMET model preparer before creating the QuantSim model. Closing the ticket for now. If needed please re-open it. |
hi.Can you share a simple code that shows how to quantify yolov5 using aimet? When I call "model=prepare_model(model)" I get all kinds of errors. I don't know how to fix it. |
Hello @haohao-qw AIMET model preparer uses torch FX symbolic trace to perform auto replacement of functional operations with nn type modules and inherits the limitations of torch FX symbolic trace. You might have to slightly modify the model definition in order to successfully prepare your model. We have captured workarounds to resolve these limitations with code examples. Please let us know if this doesn't help. |
Hi, I appreciate your contribute.
I tried using quantization technique with your Aimet tool with yolov5 (version 5.0). When call function sim.compute_encodings() it throw the following error:
. As Simon Cheng direction, I quantized yolov5 successfully. However, I found that many nodes skipped when quantize so the performance of int8 model is drop. Are there any guide to fix this error? Thank you very much!
The text was updated successfully, but these errors were encountered: