hustzxd/LSQuantization

How to deploy the quantized model?

Opened this issue · 5 comments

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

Siamw commented

use original model with strict=False

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.

Siamw commented

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.

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)

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