1.启动tensorboard

tensorboard --logdir="./logs" --port 6006

 

2.显示graph

import tensorflow as tf  
a=tf.constant(2)  
b=tf.constant(3)  
x=tf.add(a,b)  
sess = tf.Session()
writer=tf.summary.FileWriter('./logs',sess.graph)  
writer.close()  

 

3.查看变量

import tensorflow as tf

a = tf.constant(1.0,name="a")    
b = tf.random_normal(shape=[], mean=0, stddev=1, name='b')    
print a.get_shape()
print b.get_shape()

x=tf.add(a,b)  

tf.summary.scalar('x', x)
tf.summary.histogram('x_h', x)

merged = tf.summary.merge_all()

sess = tf.Session()
writer=tf.summary.FileWriter('./logs',sess.graph)  

step = 0
while True:
    mysum = sess.run(merged)
    writer.add_summary(mysum,step)
    step+=1

writer.close()  

 

 

更多参考资料:http://www.jianshu.com/p/d059ffea9ec0

相关文章:

  • 2021-05-09
  • 2021-10-31
  • 2022-01-20
  • 2021-10-30
  • 2021-06-22
  • 2021-11-18
  • 2021-11-30
  • 2021-12-20
猜你喜欢
  • 2021-08-05
  • 2021-04-02
  • 2022-12-23
  • 2021-09-04
  • 2021-04-09
相关资源
相似解决方案