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 graph. To be specific, CheckNumerics nodes are always removed, and Identity nodes that aren't involved in control edges are spliced out so that their input and outputs are directly connected.

Args:

  • input_graph: Model to analyze and prune.

Returns:

A list of nodes with the unnecessary ones removed.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/graph_util/remove_training_nodes

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部