pose-tensorflow icon indicating copy to clipboard operation
pose-tensorflow copied to clipboard

how to freeze graph

Open zjbaby opened this issue 6 years ago • 3 comments

@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~~

zjbaby avatar Aug 31 '18 09:08 zjbaby

Can you show the debug msg?

czhang0528 avatar Sep 06 '18 17:09 czhang0528

@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.

user2326 avatar Mar 01 '19 09:03 user2326

@zjbaby Did you manage to freeze it?

AndriiTsok avatar Apr 04 '19 20:04 AndriiTsok