3 ms·
> dump and freeze Keras' Tensorflow graphs You can get a direct reference to the graphs if you want, that will let you do anything tensorflow lets you do. I th
by candiodari 8y ago
> dump and freeze Keras' Tensorflow graphs
You can get a direct reference to the graphs if you want, that will let you do anything tensorflow lets you do. I think this is what you want:
# 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()
- danieldk 8y agoThat didn't work before, but admittedly, the last time I tried was probably 1.5 years ago.