最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - How to save checkpoint in tensorflow format in ver 2.18? - Stack Overflow

programmeradmin0浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 0

In 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")
发布评论

评论列表(0)

  1. 暂无评论