looput / PSENet-Tensorflow

TensorFlow implementation of PSENet text detector (Shape Robust Text Detection with Progressive Scale Expansion Networkt)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

固化模型的问题

Ashionnal opened this issue · comments

你好,
output_node_names = ''
output_graph_def = tf.graph_util.convert_variables_to_constants(sess,
sess.graph.as_graph_def(),
output_node_names.split(","))

固化模型的时候需要这个参数,请问这个输出节点是什么呢

大佬你好,我写好了,不知道这样写是否正确

保存模型

        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))