eldar / pose-tensorflow

Human Pose estimation with TensorFlow framework
GNU Lesser General Public License v3.0
1.14k stars 384 forks source link

how to freeze graph #84

Open zjbaby opened 6 years ago

zjbaby commented 6 years ago

@eldar & @andreas-eberle Hi, I try to freeze your model by the following code: restorer = tf.train.Saver() sess = tf.Session() sess.run(tf.global_variables_initializer()) sess.run(tf.local_variables_initializer())

restore variables from disk ckpt file.

restorer.restore(sess, "model/mpii/mpii-single-resnet-101")

write graph

tf.train.write_graph(sess.graph_def, './', 'graph_unfreeze.pb', as_text=True)

freeze graph

freeze_graph.freeze_graph('./graph_unfreeze.pb', '', False, "model/mpii/mpii-single-resnet-101", 'pose/part_pred/block4/BiasAdd,pose/locref_pred/block4/BiasAdd', None, None, './frozen_graph.pb', False, "")

The "frozen_graph.pb" file is generated successfully. But when I use the "frozen_graph.pb" file to estimatie body part, the result is wrong, and I don't know why.

Can you help me to export the graph? Thank you very much~~

czhang0528 commented 6 years ago

Can you show the debug msg?

user2326 commented 5 years ago

@zjbaby How did you know the output nodes ('pose/part_pred/block4/BiasAdd,pose/locref_pred/block4/BiasAdd) ?? I am trying to convert the model to onnx but unable to convert as a conversion tool is not getting the output node recognized. Please assist.

AndriiTsok commented 5 years ago

@zjbaby Did you manage to freeze it?