×
TensorFlow 教程TensorFlow 简介TensorFlow 安装人工智能简介TensorFlow 数学基础机器学习和深度学习TensorFlow 基础TensorFlow 卷积神经网络TensorFlow 递归神经网络TensorBoard 可视化TensorFlow 单词嵌入TensorFlow 单层感知TensorFlow 线性回归TFLearn 安装和使用TensorFlow CNN和RNN区别TensorFlow KerasTensorFlow 分布式计算TensorFlow 导出TensorFlow 多层感知器学习TensorFlow 感知器隐藏层TensorFlow 优化器TensorFlow XOR实现TensorFlow 梯度下降优化TensorFlow 成型图表TensorFlow 识别图像神经网络训练的建议

TensorFlow导出


在这里,将重点关注和学习TensorFlow中的MetaGraph形成。这有助于了解TensorFlow中的导出模块。MetaGraph包含基本信息,这些信息是对先前训练过的图表进行训练,执行评估或运行推理所必需的。

以下是相同的代码片段 -

def export_meta_graph(filename = None, collection_list = None, as_text = False): 
   """this code writes `MetaGraphDef` to save_path/filename. 

   Arguments: 
   filename: Optional meta_graph filename including the path. collection_list: 
      List of string keys to collect. as_text: If `True`, 
      writes the meta_graph as an ASCII proto. 

   Returns: 
   A `MetaGraphDef` proto. """

下面是一个典型的使用模型 -

# Build the model ... 
with tf.Session() as sess: 
   # Use the model ... 
# Export the model to /tmp/my-model.meta. 
meta_graph_def = tf.train.export_meta_graph(filename = '/tmp/my-model.meta')

分类导航

关注微信下载离线手册

bootwiki移动版 bootwiki
(群号:472910771)