0

I have code like the following:

model = tf.saved_model.load(input_model_path)

and my input is a model.pb.

I now want to convert it to keras .h5 but I don't know how to do this. Is there a way to convert this saved model to keras format directly?

I also tried doing it with

model = tf.keras.models.load_model(input_model_path)

but this gives me another error (IndexError)

lkuebler
  • 11
  • 1
  • Does this answer your question? [Tensorflow (.pb) format to Keras (.h5)](https://stackoverflow.com/questions/59375679/tensorflow-pb-format-to-keras-h5) – Ron Oct 28 '21 at 18:00
  • Nope, with that I get the following error: IndexError: list index (0) out of range – lkuebler Oct 28 '21 at 18:32
  • As this is my second day trying this and finding people also having the same problems. I am not going to continue with this saved_model and instead will create a keras model from start on. Proof of the non-existence of the conversion: github.com/keras-team/keras/issues/5273 These ones also state that it is almost impossible without a ton of work.. :) github.com/tensorflow/tensorflow/issues/42425 github.com/lobe/lobe-python/issues/27 – lkuebler Oct 29 '21 at 12:54

0 Answers0