# Why does keras model get bigger after training? [closed]

I notice that I create a model using tensorflow.keras.Sequential(), save it and the file size is around 5 MiB, but after I call model.fit(..), the file size is increased to 17 MiB. I copied the model to reduce the filesize and see that the accuracy is the same.

My question is, what exactly is the content of extra 12 MiB that fit() produces? How can I access such content? If I remove those extra 12 MiB, could it affect prediction accuracy or any weird side-effect?

See my experiment code here: https://nbviewer.jupyter.org/github/off99555/TensorFlowExperiments/blob/master/test-save-keras-model.ipynb

With this in mind, when you save your model please make sure to set include_optimizer=False if you seem to use an optimizer that maintains big state similar to Adam.