tensorflow1.X可视化图tensorboard

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import tensorflow as tf
import os

#建立一个图
x = tf.Variable([[1,1]], name='n_x')
w = tf.Variable([[2,2],[2,2]],name='n_w')
b = tf.Variable([[3,3]], name='n_b')
y = tf.matmul(x,w)+b

#1 序列化,将(空)图写入本地(名: events.)
sess=tf.Session()
tf.summary.FileWriter('./logs/',graph=sess.graph)

#2 启动监听,变化时自动更新
os.system('tensorboard --logdir logs')

转载请注明来源 https://tianweiye.github.io