Slide 34
Slide 34 text
C-LIS CO., LTD.
def _export_graph(sess, epoch):
constant_graph_def = graph_util.convert_variables_to_constants(
sess, sess.graph_def, ["output/logits"])
file_path = os.path.join(FLAGS.graph_dir, 'graph_%02d_epoch.pb' % epoch)
with gfile.FastGFile(file_path, 'wb') as f:
f.write(constant_graph_def.SerializeToString())
άϥϑʴύϥϝʔλʔ
with tf.gfile.FastGFile(graph_file, 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
_ = tf.import_graph_def(graph_def, name='')