codecamp

TensorFlow函数教程:tf.io.write_graph

tf.io.write_graph函数

别名:

  • tf.io.write_graph
  • tf.train.write_graph
tf.io.write_graph(
    graph_or_graph_def,
    logdir,
    name,
    as_text=True
)

定义在:tensorflow/python/framework/graph_io.py。

将图形原型写入文件。

除非as_text是False,否则该图形将被写为文本原型。

v = tf.Variable(0, name='my_variable')
sess = tf.Session()
tf.train.write_graph(sess.graph_def, '/tmp/my-model', 'train.pbtxt')

或者:

v = tf.Variable(0, name='my_variable')
sess = tf.Session()
tf.train.write_graph(sess.graph, '/tmp/my-model', 'train.pbtxt')

参数:

  • graph_or_graph_def:Graph或GraphDef协议缓冲区。
  • logdir:写入图形的目录。这可以指远程文件系统,例如Google Cloud Storage(GCS)。
  • name:图形的文件名。
  • as_text:如果为True,将图形写为ASCII原型。

返回:

输出原型文件的路径。

TensorFlow函数教程:tf.io.write_file
TensorFlow函数教程:tf.io.gfile.copy
温馨提示
下载编程狮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; }