This repository contains a project that aims to quantize a deep learning model. I've used specifically a VGG model. The code is inspired by the MIT Han Lab and is configured using Poetry for dependency management. The project utilizes torch-cpu for model operations.
- Int8 weights and activations quantization.
- Per-channel weight quantization.
- Affine quantization for activations.
- Float model accuracy : 92.95%
- Int8 model accuracy : 92.74%
- Clone the repository:
git clone https://github.com/AyoubMDL/torch_quantization.git
cd torch_quantization
- Install dependencies
poetry install
- Activate the virtual environment:
poetry shell
- Run main file that loads pretrained VGG model and quantize it. Note that evaluation on quantized model take more time as it uses Int operation on Conv and Linear layers
python main.py