Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pb #11

Open
kingskymoon opened this issue Jan 13, 2022 · 0 comments
Open

pb #11

kingskymoon opened this issue Jan 13, 2022 · 0 comments

Comments

@kingskymoon
Copy link

kingskymoon commented Jan 13, 2022

Hello,I want to freeze the graph, switch ckpt to pb files. But I failed because of the wrong name of the "output_node_names".

the code is like this:

`def freeze(input_checkpoint, output_graph):
output_node_names = "pose_exp_net/pose/mul:0"
saver = tf.train.import_meta_graph(input_checkpoint + '.meta', clear_devices=True)
with tf.Session() as sess:
saver.restore(sess, input_checkpoint) #
output_graph_def = graph_util.convert_variables_to_constants(
sess=sess,
input_graph_def=sess.graph_def,
output_node_names=output_node_names.split(","))

    with tf.gfile.GFile(output_graph, "wb") as f:  
        f.write(output_graph_def.SerializeToString())  
    print("%d ops in the final graph." % len(output_graph_def.node))  

I dont know how to tackle it , maybe I dont understand the whole project totally. I will be very appreciated if you can answer my questions above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant