Skip to content
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

QAT demo tutorial error #3044

Open
1826133674 opened this issue Jun 13, 2024 · 0 comments
Open

QAT demo tutorial error #3044

1826133674 opened this issue Jun 13, 2024 · 0 comments

Comments

@1826133674
Copy link

Hello,
I am doing QAT training and follow the tutorial below:https://quic.github.io/aimet-pages/releases/latest/api_docs/torch_quantsim.html#code-example-quantization-aware-training-qat

When I reached the last step of exporting the model, I encountered the following error:

ValueError: Only ACTIVE QcQuantizeOpMode is supported while using StaticGridQuantWrapper。

I'm not sure if this is because the quantization parameters are not calculated during the training process of QAT。
In other words, the sim.compute_encodings method is not called during the training process。
If so, please tell me the correct place to use this method. If not, please tell me the possible reasons and solutions, thank you very much!

ImageNetDataPipeline.finetune(quant_sim.model, epochs=1, learning_rate=5e-7, learning_rate_schedule=[5, 10],
use_cuda=use_cuda)

Determine simulated accuracy

accuracy = ImageNetDataPipeline.evaluate(quant_sim.model, use_cuda)
print(accuracy)
quant_sim.export(path='./', filename_prefix='quantized_resnet18', dummy_input=dummy_input.cpu())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant