5

I have an old model defined and trained using tensorflow, and now I would like to work on it but I'm currently using Keras for everything.

So the question is: is it possible to load a tf cehckpoint (with *.index, *.meta etc..) into a Keras model?

I am aware of old questions like: How can I convert a trained Tensorflow model to Keras?.

I am hoping that after 2 years, and with keras being included into tf, there would be a easier way to do it now.

Unfortunately I don't have the original model definition in tf; I may be able to find it, but it would be nicer if it wasn't necessary.

Thanks!

1 Answer 1

2

In the below link, which is the official TensorFlow tutorial, the trained model is saved and it has .ckpt extension. After, it is loaded and is used with Keras model.

I think it might help you.

https://www.tensorflow.org/tutorials/keras/save_and_restore_models

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you! Unfortunately, as I mentioned, I don't really have the original model definition code, so I would need a way to load the model definition from the checkpoint before using load_weights()
Sorry, I misunderstood that part! According to the below link (section 3a), you can use .meta file in order to create your network without manually. cv-tricks.com/tensorflow-tutorial/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.