DingXiaoH / RepVGG

RepVGG: Making VGG-style ConvNets Great Again
MIT License
3.31k stars 434 forks source link

Re-params quantized RepVGG model #91

Closed thancaocuong closed 2 years ago

thancaocuong commented 2 years ago

Hi, thank you for your great works. I have one question that can I re-param the quantized RepVGG model after doing quantization aware training?

darrenzhang1007 commented 2 years ago

Hi, thank you for your great works. I have one question that can I re-param the quantized RepVGG model after doing quantization aware training?

Hello, I met the same question. Can you tell me your solution to this problem. Thanks.

thancaocuong commented 2 years ago

Hi, thank you for your great works. I have one question that can I re-param the quantized RepVGG model after doing quantization aware training?

Hello, I met the same question. Can you tell me your solution to this problem. Thanks.

Hi, In this repo, the author quantize the model before switching the model to the inference mode. In my case, I have switched my model to inference mode then do quantization (fake quantization) and do quantization aware training. The accuracy of the downstream task drop about 0.5% (acceptable in my case). I have use pytorch-quantization tools written by NVidia. You can take a look at this repo (https://github.com/NVIDIA/TensorRT/tree/main/tools/pytorch-quantization/pytorch_quantization), very easy to use.