Giter Site home page Giter Site logo

Comments (7)

AssiaBou avatar AssiaBou commented on May 24, 2024 1

Yes I use my old code, where I save my model in .h5 file not .keras
You don't have to change anything, you just have to iinstall an older version of keras and everything will be OK

from keras-io.

AssiaBou avatar AssiaBou commented on May 24, 2024

I have the same problem in Kaggle notebook while executing the following code:
history=model1.fit(train_img_datagen, steps_per_epoch=steps_per_epoch, epochs=100, verbose=1, callbacks = [ keras.callbacks.ModelCheckpoint('UNet_100.h5', save_weights_only=False, save_best_only=True, monitor='val_loss', mode='min'), keras.callbacks.ReduceLROnPlateau(), ], validation_data=val_img_datagen, validation_steps=val_steps_per_epoch, )

from keras-io.

AssiaBou avatar AssiaBou commented on May 24, 2024

@kishan042p I have just solved the problem by installing an older versio of keras:

!pip install keras==2.15.0
import keras
print(keras.version)

But you have to restart your kernel before using it,

Good luck

from keras-io.

kishan042p avatar kishan042p commented on May 24, 2024

@kishan042p I have just solved the problem by installing an older versio of keras:

!pip install keras==2.15.0 import keras print(keras.version)

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.

from keras-io.

sachinprasadhs avatar sachinprasadhs commented on May 24, 2024

In Keras 3, for checkpoint filepath, you need to provide in .keras format only, if you're saving only weights file name should end with .weights.h5.

You can save and load the model in .h5 using below method
https://keras.io/guides/migrating_to_keras_3/#saving-a-model-in-the-tf-savedmodel-format

from keras-io.

russell919 avatar russell919 commented on May 24, 2024

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:
CKPT_path = "Model_ckpt.weights.h5"
checkpointing_cb = tf.keras.callbacks.ModelCheckpoint(CKPT_path, save_best_only=True, save_weights_only=True)

from keras-io.

github-actions avatar github-actions commented on May 24, 2024

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.

from keras-io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.