-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ValueError: The filepath provided must end in .keras
(Keras model format). Received: filepath=Model_ckpt.h5
#1844
Comments
I have the same problem in Kaggle notebook while executing the following code: |
@kishan042p I have just solved the problem by installing an older versio of keras: !pip install keras==2.15.0 But you have to restart your kernel before using it, Good luck |
But i Want to save model in .h5 file not in .keras so please provide solution regarding it. |
Yes I use my old code, where I save my model in .h5 file not .keras |
In Keras 3, for checkpoint filepath, you need to provide in You can save and load the model in .h5 using below method |
In Keras 3, if you want to save your model in .h5 file in any case, set "save_weights_only=True", and change your flie name to "xxx.weights.h5". for your code: |
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. |
This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further. |
https://keras.io/guides/migrating_to_keras_3/#saving-a-model-in-the-tf-savedmodel-format "The following snippet of code will reproduce the above error:
How to fix it: use model.export(filepath) instead of model.save(filepath)" |
In Keras 3, if you want to save your model in .h5 file in any case, set "save_weights_only=True", and change your flie name to "xxx.weights.h5". for your code: |
Issue Type
Support
Source
source
Keras Version
3.2.1
Custom Code
Yes
OS Platform and Distribution
Linux Ubuntu 22.04.4
Python version
3.11.5
GPU model and memory
16 gm
Current Behavior?
please solve this error
Standalone code to reproduce the issue or tutorial link
Relevant log output
The text was updated successfully, but these errors were encountered: