LSQuantization icon indicating copy to clipboard operation
LSQuantization copied to clipboard

How to deploy the quantized model?

Open jiinhui opened this issue 3 years ago • 5 comments

When we have trained the quantization model, how to deploy it?

jiinhui avatar Oct 08 '21 03:10 jiinhui

use original model with strict=False

Siamw avatar Nov 01 '21 08:11 Siamw

use original model with strict=False

I mean it is different with the official interface about the Quantization Aware Training(https://pytorch.org/docs/stable/quantization.html),I don't know how to get the int8 model from the trained model.

jiinhui avatar Nov 15 '21 09:11 jiinhui

not sure what int8 model means.

anyway, i use this method. at model init part,

during training self.conv1 = lsqconv(~~)

during inferencing self.conv1 = nn.Conv2d(~~)

name "self.conv1" does not changed and weights/ bias shapes are same between them. so it works.

i wrote "using strict=false" because if not, it causes error when using upper codes.

Siamw avatar Nov 15 '21 09:11 Siamw

not sure what int8 model means.

anyway, i use this method. at model init part,

during training self.conv1 = lsqconv(~~)

during inferencing self.conv1 = nn.Conv2d(~~)

name "self.conv1" does not changed and weights/ bias shapes are same between them. so it works.

i wrote "using strict=false" because if not, it causes error when using upper codes.

int8 means 8 bit , which is quantized from the float model (32 bit)

jiinhui avatar Nov 15 '21 10:11 jiinhui

Hello,请问你的这个问题后来弄清楚了吗,我刚接触,现在也想知道怎么得到int8模型

BYFgithub avatar Sep 02 '23 12:09 BYFgithub