tensorboard启动教程

import tensorflow as tf

with tf.name_scope('graph') as scope:
     matrix1 = tf.constant([[3., 3.]],name ='matrix1')  #1 row by 2 column
     matrix2 = tf.constant([[2.],[2.]],name ='matrix2') # 2 row by 1 column
     product = tf.matmul(matrix1, matrix2,name='product')

sess = tf.Session()

writer = tf.summary.FileWriter("logs/", sess.graph) #第一个参数指定生成文件的目录。

init = tf.global_variables_initializer()

sess.run(init)

在logs目录下回生成一个文件
tensorboard启动教程_第1张图片
在cmd中进入该文件的上级目录,输入

tensorboard --logdir "./logs"

tensorboard启动教程_第2张图片
tensorboard启动教程_第3张图片
会返回一个连接,不用管,直接在浏览器的地址栏输入

localhost:6006

就可以看到
tensorboard启动教程_第4张图片

你可能感兴趣的:(tensorflow,tensorboard)