0

i have a saved_model.pb file and a .ckpt file for a tensorflow model. I need to recover the summary of the model. I tried this code:

loaded = tf.saved_model.load(model_path)
loaded.summary()

But i get this error:

AttributeError: 'AutoTrackable' object has no attribute 'summary'

I have found out that the reason i get this error is that my model is a tensorflow model and not a keras model, and that I have to convert it into a keras model. However, all the solutions i found assume that i know the structure of the model, which i do not know. Is there a way to convert the saved_model.pb or the .ckpt file directly in a keras model, without building it again?

eshirvana
  • 23,227
  • 3
  • 22
  • 38
Lorenzo
  • 51
  • 4
  • Does this answer your question? [Tensorflow (.pb) format to Keras (.h5)](https://stackoverflow.com/questions/59375679/tensorflow-pb-format-to-keras-h5) – eshirvana Dec 21 '21 at 20:38
  • No, if I load it directly with keras i get: IndexError: list index (0) out of range – Lorenzo Dec 22 '21 at 09:17

0 Answers0