Commit 56f982a2 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

now saves *.pb - it's enough to run just this script

parent f0673b1a
......@@ -345,9 +345,15 @@ with tf.Session() as sess:
"""
image_data[nimg] = None
# is this needed? why would it be?
#meta_graph_def = tf.train.export_meta_graph(files["inference"]+'.meta')
"""
Save MetaGraph to Saved_Model in *.pb (protocol buffer) format to
be able to use from Java
"""
# force clean
shutil.rmtree(dirs['exportdir'], ignore_errors=True)
builder = tf.saved_model.builder.SavedModelBuilder(dirs['exportdir'])
builder.add_meta_graph_and_variables(sess,[tf.saved_model.tag_constants.SERVING],main_op=tf.local_variables_initializer())
builder.save(False) # True = *.pbtxt, False = *.pb
if lf:
lf.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment