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

Fix bug where a model with empty weights fails to load #7868

Merged
merged 10 commits into from
Aug 21, 2023

Conversation

thekevinscott
Copy link
Contributor

@thekevinscott thekevinscott commented Jul 22, 2023

First draft at addressing #7865.

This slightly refactors the Container.loadWeights function by pulling the "is this model a keras model" into a standalone function. That function will first assert that the model has non-empty weights before checking the first weight's name (which is subsequently used to determine keras-ness or not).

This also adds a unit test in model_save_test.ts enforcing that a model with empty weights can still be loaded.

@pyu10055 pyu10055 requested a review from fengwuyao July 26, 2023 18:20
@pyu10055
Copy link
Collaborator

/gcbrun

Copy link
Collaborator

@fengwuyao fengwuyao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks!

@thekevinscott
Copy link
Contributor Author

Just merged in latest master. Is there something I need to do prior to merge, or is this in y'all's hands now?

@pyu10055
Copy link
Collaborator

/gcbrun

@pyu10055 pyu10055 enabled auto-merge (squash) August 21, 2023 21:23
@pyu10055 pyu10055 disabled auto-merge August 21, 2023 22:36
@pyu10055 pyu10055 merged commit 20ceb6f into tensorflow:master Aug 21, 2023
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

Successfully merging this pull request may close these issues.

4 participants