codecamp

TensorFlow函数:tf.graph_util.remove_training_nodes

tf.graph_util.remove_training_nodes函数

tf.graph_util.remove_training_nodes(
    input_graph,
    protected_nodes=None
)

定义在:tensorflow/python/framework/graph_util_impl.py.

删除不需要进行推理(inference)的节点.

在训练过程中,有一些节点,比如Identity和checknerics,它们只在训练时有用,并且可以在仅用于推理的图形中删除.我们识别并删除它们,返回一个等效图.具体而言,CheckNumerics节点总是被删除,并且没有涉及控制边缘的Identity节点被拼接出来,以便它们的输入和输出直接连接.

参数:

  • input_graph:需要分析和删除的模型.
  • protected_nodes:无条件保留的节点名称的可选列表.这对于保留标识输出节点非常有用.

返回值:

tf.graph_util.remove_training_nodes函数删除了不必要的节点的列表.

TensorFlow函数:tf.graph_util.must_run_on_cpu
TensorFlow函数:tf.graph_util.tensor_shape_from_node_def_name
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

TensorFlow 函数介绍

TensorFlow 函数模块:tf

TensorFlow的image模块

TensorFlow使用之tf.io

TensorFlow使用之tf.keras

TensorFlow函数教程:tf.keras.applications

TensorFlow函数教程:tf.keras.backend

TensorFlow使用之tf.metrics

TensorFlow使用之tf.nn

TensorFlow使用之tf.python_io

TensorFlow 功能函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }