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

loss/losses are omitted from get_config/serialization #19884

Open
sikchi opened this issue Jun 19, 2024 · 1 comment
Open

loss/losses are omitted from get_config/serialization #19884

sikchi opened this issue Jun 19, 2024 · 1 comment
Assignees
Labels

Comments

@sikchi
Copy link

sikchi commented Jun 19, 2024

opening a new issue since #19820 is closed.

Based on this - https://keras.io/api/models/model_saving_apis/ I assume I should be able to save a partially trained model using model.save(), then load it using load_model(), and resume training. If my assumption is true, then there are more issues like #19820

For e.g., for a trained model with a (non-custom) Loss, model.get_config().get("losses") and model.get_config.get("loss") both return None. Whereas model.losses and model.loss work as expected. Consequently, those properties don't roundtrip via save() and load_model().

@mehtamansi29 mehtamansi29 added type:Bug keras-team-review-pending Pending review by a Keras team member. labels Jun 21, 2024
@SamanehSaadat
Copy link
Member

Is there any reason that you're not using ModelCheckpoint callback for saving and loading later to continue training?

I believe our Saving API is mainly designed for saving a finalized model and doesn't have to keep training information.

cc @nkovela1

@SamanehSaadat SamanehSaadat removed the keras-team-review-pending Pending review by a Keras team member. label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants