tf.graph_util.remove_training_nodes

tf.graph_util.remove_training_nodes

tf.graph_util.remove_training_nodes

remove_training_nodes(input_graph)

Defined in tensorflow/python/framework/graph_util_impl.py.

Prunes out nodes that aren't needed for inference.

There are nodes like Identity and CheckNumerics that are only useful during training, and can be removed in graphs that will be used for nothing but inference. Here we identify and remove them, returning an equivalent grap