tensorboard入门代码

 

import tensorflow as tf

with tf.name_scope("input1"):
    input1 = tf.constant([1.0, 2.0, 3.0], name="input1")
with tf.name_scope("input2"):
    input2 = tf.Variable(tf.random_uniform([3]), name='input2')  # shape = 3

output = tf.add_n([input1, input2], name='add')        # 实现一个列表的元素的相加,没有广播功能
print(output)

writer = tf.summary.FileWriter('D:/python/deep-learning/MRI-2D/BMP-cnn/to/log', tf.get_default_graph())
writer.close()
(1). 在控制台调用命令:tensorboard --logdir=D:/python/deep-learning/MRI-2D/BMP-cnn/to/log
(2). 打开浏览器输入地址 http://zxj-DELL-G7:6006(运行后控制台会显示),默认进入GRAPHS界面,点开上方的INACTIVE选项可以选择其他可视化内容。
(3). Tensorboard支持通过TensorFlow命名空间来整理可视化效果图上的节点:TensorFlow计算图中同一个命名空间下的所有节点会被缩略成一个节点(除了顶层命名空间)。

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章