import tensorflow as tf

    print("***************")
    print("Training done!!")
    save_path = saver.save(sess, ckpt_name)
    print("Model saved in file: %s" % save_path)


print ("creating protobuf...")
g_1 = tf.get_default_graph()
with tf.Session(graph = g_1) as sess:
    saver = tf.train.import_meta_graph('save/model.ckpt.meta', clear_devices=True)
    saver.restore(sess, ckpt_name)
    graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, dst_nodes)
    tf.train.write_graph(tf.graph_util.extract_sub_graph(graph_def, dst_nodes), path, fname, as_text=False)
