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

About yolov7_qat, report a bug for cmd_sensitive_analysis in qat.py #45

Open
darrenzhang1007 opened this issue May 11, 2023 · 2 comments

Comments

@darrenzhang1007
Copy link

darrenzhang1007 commented May 11, 2023

Very appreciate having such a good job. I want to report a bug for cmd_sensitive_analysis in qat.py

When calling the quantize.calibrate_model function, a device parameter is underwritten, causing the run to fail.

quantize.calibrate_model(model, train_dataloader)

image

@darrenzhang1007
Copy link
Author

darrenzhang1007 commented May 11, 2023

I also have some questions to ask you.

  1. In Guidance_of_QAT_performance_optimization.md, How yolov7_qat.onnx was obtained during the Run QAT benchmark process.

I guessed yolov7_qat.onnx was obtained by the process at first. Then run the qat running-code and get qat.onnx.

Is the qat.onnx I got already the best model?
Does this process include this step

  1. The input dimensions of the onnx exported in the two tutorials are different. It makes me confuse!

The input of the exported onnx is 1*3*672*672 by this process

The input of the exported onnx is 1*3*640*640 by this process

This infer_eval code explicitly requires that the input dimension of the engine is 672*672

@wanghr323
Copy link
Collaborator

@darrenzhang1007
How yolov7_qat.onnx was obtained during the Run QAT benchmark process.

After you finish the qat training via qat.py, You could got the qat.onnx. The guidance is mainly telling you: For current version of TensorRT, User can always got the best perf on PTQ(onnx model without QDQ nodes), But QAT will not, In this way, if we want to get the same perf as PTQ in QAT model(model with QDQ nodes), We should adjust the QDQ placement to let the TensorRT have the same behavior as PTQ(they export the same graph)

The input dimensions of the onnx exported in the two tutorials are different. It makes me confuse!

you can see the https://github.com/WongKinYiu/yolov7.git, When running the evaluation, it will run with 13672*672(that will got the best accuracy, seems all the yolo will do this), we just keep aligned with them.

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

2 participants