How to quantize and compress the trained model???
APeiZou opened this issue · comments
APeiZou commented
How to quantize and compress the trained model??????
THUMIG_discarded commented
You can load the model and call the torchslim.quantization.qat.QATSolver to do the quantization aware train,the model can be automatically converted into the tensorrt format.
The simple example is here
https://github.com/THU-MIG/torch-model-compression/blob/main/examples/torchslim/pytorch-cifar/qat.py
The source code is here
https://github.com/THU-MIG/torch-model-compression/blob/main/torchslim/quantizing/qat.py