rcmalli / keras-squeezenet

SqueezeNet implementation with Keras Framework
MIT License
404 stars 146 forks source link

Model size? #22

Open mrgloom opened 5 years ago

mrgloom commented 5 years ago

Here is the code to reproduce result:

import numpy as np
from keras_squeezenet import SqueezeNet
from keras.applications.imagenet_utils import preprocess_input, decode_predictions
from keras.preprocessing import image

model = SqueezeNet()
model.save_weights('model_weights.h5')
model.save('model.h5')

Why model is so big?

du -sh *.h5
4.9M    model.h5
4.9M    model_weights.h5

It's strange, but after running scripts second time I get, what is the reason?

5.9M    model.h5
5.9M    model_weights.h5

In my older Caffe experiments SqeezeNet v1.1 have size 2.9 Mb: https://github.com/mrgloom/kaggle-dogs-vs-cats-solution

mrgloom commented 5 years ago

Looks like in paper it's 4.8 Mb, so it's comparable: https://arxiv.org/pdf/1602.07360.pdf