1

I am loading a MetaGraph from .meta and .ckpt file

meta_graph = tf.train.import_meta_graph(meta_file)
with tf.Session() as sess:
    meta_graph.restore(tf.get_default_session(), ckpt_file)

and a Graph from .pb file

with gfile.FastGFile(pb_file,'rb') as f:
    graph_def = tf.GraphDef()
    graph_def.ParseFromString(f.read())
    tf.import_graph_def(graph_def, name='')

current_graph = tf.get_default_graph()

and then I would like to convert any of them into a Keras model or .h5 file directly.

But I am unable to find a helper function for this. Neither does MetaGraph or Graph have an export utility for Keras or .h5, nor does Keras have an import function for MetaGraph or Graph.

Please help me cross the bridge.

Files can be found here : https://github.com/davidsandberg/facenet#pre-trained-models (VGGFace 2) or https://drive.google.com/file/d/1EXPBSXwTaqrSC0OhUdXNmKSh9qJUQ55-/view

parthagar
  • 880
  • 1
  • 7
  • 18

0 Answers0