Skip to content

Instantly share code, notes, and snippets.

@Hiromi-nee
Created June 29, 2018 01:44
Show Gist options
  • Save Hiromi-nee/00aa5ec6980417f77bc6bdaf273ff95a to your computer and use it in GitHub Desktop.
Save Hiromi-nee/00aa5ec6980417f77bc6bdaf273ff95a to your computer and use it in GitHub Desktop.
# This assumes your model is ready to be called with .predict()
sess = keras.get_session()
graph = sess.graph
graph_dev = graph.as_graph_def()
frozen_graph = tf.graph_util.convert_variables_to_constants(
sess, graph_def, nodes_to_output)
encoded_frozen_graph = frozen_graph.SerializeToString()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment