This project perform post-training static quantization in Pytorch using ResNet18 architecture.
- Clone the project.
- Install packages required.
- Run the notebook.
-
Clone project from GitHub.
Change to the directory static_quantization. -
Install packages
In order to reproduce the code install the packagespip install torch==1.5.1 pip install torchvision==0.6.1 pip install matplotlib
-
Run the notebook.
In this notebook we use MNIST data set for experimenting.
Below are the results obtained on the test set for the models trained in the project.
NOTE
The results obtained are system specific. Due to different combinations of the neural network cudnn library versions and NVIDIA driver library versions, the results can be slightly different. To the best of my knowledge, upon reproducing the environment, the ballpark number will be close to the results obtained.
Models | Accuracy (%) | Memory size (MB) | Inference time (ms) |
---|---|---|---|
Original | 99.28 | 44.76 | 15.06 |
Quantized | 99.26 | 11.20 | 3.64 |