**
一、tensorboard的安装
**
使用命令pip install tensorboard
**
二、使用方法
**
2.1、启动listener
在项目所在的目录创建文件夹logs用于存放监听数据
使用命令行中定位到项目所在的文件夹,并使用命令tensorboard --logdir logs启用listener
使用浏览器输入localhost:6006打开端口
2.2、使用代码创建summary
current_time = datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
log_dir = 'logs/' + current_time
summary_writer = tf.summary.create_file_writer(log_dir)
2.3、喂入需要监听的数据
with summary_writer.as_default():
tf.summary.image('Training Sample[0]',data=sample_img,step=0)#喂入单张图片数据