-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Polygraphy: How to write the data_loader.py to send the calibration data? #4196
Comments
Use However, use Then I write a
|
I think the trtexec and polygraphy commands should be doing the same thing. Not sure why they are giving different results. |
|
I have tried to use 500/1000 and more than 3000 images to calibrate the model, However, the result is almost the same. |
Calibration is performed on FP32 models generally. Can you try feeding in FP32 inputs instead? Also make sure that you apply the same preprocessing as you do for inference. |
I used fp16 when training the network. So do I need use fp32 to calibrate the model when I quantize it? |
I believe so. We disable FP16 mode when calibrating. The other option is to use quantization-aware training so that the model already has quantization information baked in, or use ModelOpt to do post-training quantization. |
OK. Thank you. I will have a try. |
The example data_loader.py file used the fake data.
I want to know how to write the file to send image files data to Polygraphy to calibrate the model and improve the accuracy.
Such as the axis, the data range, and so on.
The axis is
image_num, image_channel, height, width
or the other?The data range is
[0, 1] or [0, 255]
? It should be the same as the pth model input or be stricted to a fixed range?Thank you for any suggestions or help.
The text was updated successfully, but these errors were encountered: