You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, for some reason, I have to frozen the variables of checkpoints file and export the graph to pb file. After research the graph structure, I export the pb file successfully using flowing code:
output_node_names = ['digit_length/dense/BiasAdd','stack']
with tf.Session() as sess:
# Restore the graph
saver = tf.train.import_meta_graph(FLAGS.meta_path)
# Load Weight
saver.restore(sess, FLAGS.checkpoint_path)
# Freeze the graph
frozen_graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, output_node_names)
# Save the frozen graph
with open('output/svhnclassification.pb', 'wb') as output:
output.write(frozen_graph_def.SerializeToString())
But then I don't know how to load this pb file, and input a image nparray into the graph to get the predict result. Could you help me?
Thanks
The text was updated successfully, but these errors were encountered:
Hello, for some reason, I have to frozen the variables of checkpoints file and export the graph to pb file. After research the graph structure, I export the pb file successfully using flowing code:
But then I don't know how to load this pb file, and input a image nparray into the graph to get the predict result. Could you help me?
Thanks
The text was updated successfully, but these errors were encountered: