import tensorflow as tf#定义计算图g = tf.Graph()with g.as_default(): hello = tf.constant('hello',name = 'hello') world = tf.constant('world',name = 'world') helloworld = tf.string_join([hello,world],name = 'join',separator=' ')#执行计算图with tf.Session(graph = g) as sess: print(sess.run(fetches = helloworld,feed_dict={}))#查看计算图with tf.summary.FileWriter('F:\lys\my_graph') as writer: writer.add_graph(g)#1,在命令行中切换到 F:\lys\my_graph#2,运行 tensorboard --logdir=my_graph#3, 打开浏览器输入地址http://localhost:60061.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.
或者
writer = tf.summary.FileWriter('F:\lys\my_graph', tf.get_default_graph())writer.close()1.2.
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删