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

ModelCheckpoint callback crashes if filename doesn't end with .weights.h5 #1568

Closed
erickrf opened this issue Nov 3, 2023 · 4 comments
Closed

Comments

@erickrf
Copy link

erickrf commented Nov 3, 2023

When using the callback ModelCheckpoint, the path argument for saving the model must end with .weights.h5, or else it raises an error like this:

ValueError: The filename must end in `.weights.h5`. Received: filepath=/tmp/model.keras
@sachinprasadhs
Copy link
Collaborator

Hi,

Thanks for reporting the issue.

Below is the recommended way of saving model weights in new Keras 3.

model.save('my_model.keras') # (recommended)```


to save the weight file using .h5, save it like below.


`model.save_weight('my_model.weights.h5`)`

@innat-asj
Copy link

keras-team/keras#18613 (comment)

Copy link

This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label Nov 22, 2023
Copy link

github-actions bot commented Dec 7, 2023

This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.

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

No branches or pull requests

3 participants