Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about the size of the trained model file(Emotion classification) #155

Closed
David9591 opened this issue Jul 26, 2021 · 4 comments

Comments

@David9591
Copy link

In the case of emotion classification, the model file(46344KB) obtained through examples/face_classification/train.py training is much larger than the pre-training file "fer2013_mini_XCEPTION.119-0.65.hdf5" (848KB)given by you. What is the cause of this?Please forgive me for the simple question that I have raised because of my inadequate understanding of deep learning.

Best wishes!

@oarriaga
Copy link
Owner

It could be several things. One of them being that the model in train.py saves the complete state of the optimizer. How much different it is?

@David9591
Copy link
Author

It could be several things. One of them being that the model in train.py saves the complete state of the optimizer. How much different it is?

When I choose the default, I do save all the information about the model, so I have 46452KB, but when I choose save_weights_only=True, I should only keep the weight data, but it still has 15567KB, but the official model is only 848KB, which is very strange, could you please explain it for me?Thank you very much!

@oarriaga
Copy link
Owner

oarriaga commented Jul 26, 2021

It could be that they are actually different models or that the tensorflow hdf5 file weight format changed and now models are slightly bigger. One way to look into this would be to load both models and call model.summary() on both and observe the differences.

@David9591
Copy link
Author

It could be that they are actually different models or that the tensorflow hdf5 file weight format changed and now models are slightly bigger. One way to look into this would be to load both models and call model.summary() on both and observe the differences.

Yes, you are right! After printing out the structure of the model, I found that there is indeed a big difference, and the difference in the number of model parameters can also be explained. I will continue to study it in depth. Thank you for your patient answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants