Ashionnal
Ashionnal
大佬你好,我写好了,不知道这样写是否正确 # 保存模型 output_graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph.as_graph_def(), output_node_names=[var.name[:-2] for var in tf.global_variables()]) with tf.gfile.GFile('/home/yanshuxuan/gitprojects/PSENet-Tensorflow/model.pb', "wb") as f: f.write(output_graph_def.SerializeToString()) print("%d ops in the final graph." % len(output_graph_def.node))
Yes, this problem happened to me too