hahnyuan / PTQ4ViT

Post-Training Quantization for Vision transformers.
192 stars 27 forks source link

How to save quantized model? #2

Open skyloveblue opened 2 years ago

skyloveblue commented 2 years ago

Excellent work! After quantization, how to save the quantized model?

wangjingg commented 2 years ago

I also want to know how to save the quantized model

SuperVan-Young commented 2 years ago

We're still working on it, and it'll be released along with quantized models' pth files later.

If you only need quantized weights and bias, there's a way for quick start. We have implemented method quant_weight_bias in conv2d and linear layers, from which you can retreive quantized weights and bias of current layer. You can check for quant_layers/conv.py and quant_layers/linear.py for details.