looput / PSENet-Tensorflow

TensorFlow implementation of PSENet text detector (Shape Robust Text Detection with Progressive Scale Expansion Networkt)
49 stars 10 forks source link

固化模型的问题 #13

Open Ashionnal opened 4 years ago

Ashionnal commented 4 years ago

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

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

Ashionnal commented 4 years ago

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

保存模型

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