Created
August 13, 2018 12:41
-
-
Save alreadytaikeune/a135cd4e3f0905f8ec05c50c0976505a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tensorflow.python.framework import graph_util | |
# Suppose you have obtained in a way or the other a graph object, and suppose | |
# you have a list of the output nodes names (manually created after inspectection | |
# with tensorboard for example). Then, one way to build a frozen graph is the following: | |
with tf.Session(graph=graph) as sess: | |
graph_def = graph.as_graph_def() | |
frozen_graph_def = graph_util.convert_variables_to_constants( | |
sess, graph_def, output_node_names) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment