How can I convert a trained Tensorflow model to Keras?

前端 未结 4 1587
甜味超标
甜味超标 2020-12-13 06:43

I have a trained Tensorflow model and weights vector which have been exported to protobuf and weights files respectively.

How can I convert these to JSON or YAML and

4条回答
  •  遥遥无期
    2020-12-13 07:42

    Unsure if this is what you are looking for, but I happened to just do the same with the newly released keras support in TF 1.2. You can find more on the API here: https://www.tensorflow.org/api_docs/python/tf/contrib/keras

    To save you a little time, I also found that I had to include keras modules as shown below with the additional python.keras appended to what is shown in the API docs.

    from tensorflow.contrib.keras.python.keras.models import Sequential

    Hope that helps get you where you want to go. Essentially once integrated in, you then just handle your model/weight export as usual.

提交回复
热议问题