There was a feature - tensorflow format to save a checkpoint. I have checked and it is everywhere in the official docs and samples:
However in the TF I am running (2.18) if I write model.save('something')
I get this:
Invalid filepath extension for saving. Please add either a `.keras` extension for the native Keras format (recommended) or a `.h5` extension.
How do I save in "tensorflow" format in the latest versions?
There was a feature - tensorflow format to save a checkpoint. I have checked and it is everywhere in the official docs and samples: https://www.tensorflow./tutorials/keras/save_and_load#savedmodel_format
However in the TF I am running (2.18) if I write model.save('something')
I get this:
Invalid filepath extension for saving. Please add either a `.keras` extension for the native Keras format (recommended) or a `.h5` extension.
How do I save in "tensorflow" format in the latest versions?
Share Improve this question asked Feb 2 at 10:18 Boppity BopBoppity Bop 10.5k16 gold badges88 silver badges172 bronze badges 1- i know .keras/h5 works - i need TF format – Boppity Bop Commented Feb 2 at 10:43
1 Answer
Reset to default 0In TensorFlow 2.18 the behavior of model.save()
has changed. In previous versions you could save a model in the “SavedModel” (TensorFlow) format simply by calling, for example, model.save("my_model")
. Now, however, model.save()
requires that you either specify a .keras
or a .h5
extension. To save your model in the TensorFlow SavedModel format, use the save_format parameter:
model.save("my_model", save_format="tf")