mit-han-lab / haq

[CVPR 2019, Oral] HAQ: Hardware-Aware Automated Quantization with Mixed Precision
https://hanlab.mit.edu/projects/haq/
MIT License
365 stars 85 forks source link

How to measure model size? #6

Closed yzhang93 closed 5 years ago

yzhang93 commented 5 years ago

Thanks for sharing the amazing work! I'm wondering how did you measure the model size. I downloaded your pretrained model 'resnet50_0.1_75.48.pth.tar', and found the size of the model is 102.7MB which is big.

kuan-wang commented 5 years ago

We calculate the model size by summing up the product of the bit number and the parameter number of each layer. You can get the centroids and labels refer to https://github.com/mit-han-lab/haq-release/blob/70c2b77b60b1a9a02cba9fc56119ae7b2e1da576/finetune.py#L308 Then you can save it in your own format.