microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.85k stars 2.94k forks source link

Quantization of video action recognition model #10422

Open MrOCW opened 2 years ago

MrOCW commented 2 years ago

Hi,

I am looking at quantization of a SlowFast model. The input, according to netron is 1x1x3x32x256x256. May I know if it is possible to perform PTQ on the model?

Do I just implement the CalibrationDataReader to have the same preprocessing steps as the training phase such that the calibration data has the same input dimensions as the onnx model?

Thanks!

yufenglee commented 2 years ago

Yes, please refer the example here: https://github.com/microsoft/onnxruntime-inference-examples/tree/main/quantization/image_classification

MarvS95 commented 2 years ago

Hi @MrOCW

I'm also trying to make PTQ with the SlowFast Network in order to compile it for inference on an FPGA. My approach is different as I try to use the quantizer from Vitis AI. At the moment I'm struggling with the input for the slow pathway [1, 3, 8, 256, 256] and the fast pathway [1, 3, 32, 256, 256]. Does your model only have one input? Have you made any progress so far with the quantization?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details.