开发手册 欢迎您!
软件开发者资料库

TensorFlow - 导出

TensorFlow导出 - 从简单和简单的步骤学习TensorFlow,从基本到高级概念,包括简介,安装,理解人工智能,数学基础,机器学习和深度学习,基础知识,卷积神经网络,递归神经网络,TensorBoard可视化,Word嵌入,单层感知器,线性回归,TFLearn及其安装,CNN和RNN差异,Keras,分布式计算,TensorFlow导出,多层感知器学习,感知器隐藏层,TensorFlow中的优化器,XOR实现,梯度下降优化,形成图形,使用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')