Shao-kun-Zhang 8b51189d56 | 2 years ago | |
---|---|---|
.. | ||
pytorchcv | 2 years ago | |
quantization_utils | 2 years ago | |
utils | 2 years ago | |
README.md | 2 years ago | |
__init__.py | 2 years ago | |
cifar100_resnet20.hocon | 2 years ago | |
conditional_batchnorm.py | 2 years ago | |
dataloader.py | 2 years ago | |
imagenet_resnet18.hocon | 2 years ago | |
main.py | 2 years ago | |
options.py | 2 years ago | |
requirements.txt | 2 years ago | |
run.sh | 2 years ago | |
trainer.py | 2 years ago |
We provide PyTorch implementation for "Generative Low bitwidth Data Free Quantization".
Clone this repo:
git clone https://github.com/xushoukai/Generative-Low-bitwidth-Data-Free-Quantization.git
cd Generative-Low-bitwidth-Data-Free-Quantization
Install pytorch and other dependencies.
pip install -r requirements.txt
Set the "dataPath" in "cifar100_resnet20.hocon" as the path root of your CIFAR-100 dataset. For example:
dataPath = "/home/datasets/Datasets/cifar"
Set the "dataPath" in "imagenet_resnet18.hocon" as the path root of your ImageNet dataset. For example:
dataPath = "/home/datasets/Datasets/imagenet"
To quantize the pretrained ResNet-20 on CIFAR-100 to 4-bit:
python main.py --conf_path=./cifar100_resnet20.hocon --id=01
To quantize the pretrained ResNet-18 on ImageNet to 4-bit:
python main.py --conf_path=./imagenet_resnet18.hocon --id=01
Dataset | Model | Pretrain Top1 Acc(%) | W4A4(Ours) Top1 Acc(%) |
---|---|---|---|
CIFAR-100 | ResNet-20 | 70.33 | 63.58 ± 0.23 |
ImageNet | ResNet-18 | 71.47 | 60.60 ± 0.15 |
Note that we use the pretrained models from pytorchcv.
If this work is useful for your research, please cite our paper:
@InProceedings{xu2020generative,
title = {Generative Low-bitwidth Data Free Quantization},
author = {Shoukai, Xu and Haokun, Li and Bohan, Zhuang and Jing, Liu and Jiezhang, Cao and Chuangrun, Liang and Mingkui, Tan},
booktitle = {The European Conference on Computer Vision},
year = {2020}
}
This work was partially supported by the Key-Area Research and Development Program of Guangdong Province 2018B010107001, Program for Guangdong Introducing Innovative and Entrepreneurial Teams 2017ZT07X183, Fundamental Research Funds for the Central Universities D2191240.
神经网络模型压缩框架
Python Jupyter Notebook Cuda C++ Markdown other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》