tensorboard 之 TF可视化
tensorboard是TF提供的一个可视化的工具
1.tensorboard可视化的数据来源?
将tensorflow程序运行过程中输出的日志文件进行可视化展示.
1.1 tensorflow怎样输出日志文件呢?
tf.summary.FileWriter
The FileWriter class provides a mechanism to create an event file in a given directory and add summaries and events to it. The class updates the file contents asynchronously. This allows a trainin
g program to call methods to add data to the file directly from the training loop, without slowing down training.
FileWriter类使tensorboard支持异步更新程序运行状态;即tensorflow程序在在训练过程中,tensorboard可以实时的显示数据的变化
tb_ex1.py---简单的日志文件的tensorboard可视化程序

2.tensorboard可以将哪些数据进行可视化?
2.1 神经网络结构(graph)的可视化
利用命名空间使神经网络模型的结构更加清晰
tb_ex2.py---通过命名空间,使计算图的结构更加简洁

2.2 TF计算节点的运行时间和内存占用可视化
2.2.1 tf.RunOptions()#配置运行时需要记录的信息的protocolmessage
2.2.2 tf.RunMetadata()#运行时记录运行信息的protocolmessage
2.2.3 sess.run(options=run_options, run_metadata=run_metadata)
run(
fetches,
feed_dict=None,
options=None,
run_metadata=None
)
The optional options argument expects a [RunOptions] proto. The options allow controlling the behavior of this particular step (e.g. turning tracing on).
The optional run_metadata argument expects a [RunMetadata] proto. When appropriate, the non-Tensor output of this step will be collected there. For example, when users turn on tracing in options,
the profiled info will be collected into this argument and passed back.
将配置信息和记录运行信息的protocol buffer传入 运行的过程,从而记录运行时每一个节点的时间,空间的开销信息
2.2.4 FileWriter.add_run_metadata(run_metadata,)#将节点运行时的信息写入日志文件
add_run_metadata(
run_metadata,
tag,
global_step=None
)
Adds a metadata information for a single session.run() call.
Args:
run_metadata: A RunMetadata protobuf object.
tag: The tag name for this metadata.
global_step: Number. Optional global step counter to record with the StepStats.
以mnist为例,展示节点的运行时间和内存占用情况
mnist_inference.py
mnist_train.py

2.3 变量指标可视化
2.1和2.2主要是介绍了tensorboard的GRAPHS视图,来显示TF的NN结构和graph上的节点信息.TB还有SCALARS,IMAGES,AUDIO,DISTRIBUTIONS,HISTOGRAM和TEXT六个界面来可视化其他监控指标.
2.3.1 tf.summary.scalar TF中标量(scalar)监控数据随着训练(迭代)轮数的变化趋势
2.3.2 tf.summary.image TF中使用的图片数据的显示.一般用于可视化当前使用的训练或测试图片
2.3.3 tf.summary.histogram TF中tensor取值分布的监控数据随着训练(迭代)轮数的变化趋势
2.3.4 tf.summary.audio TF中使用的音频数据
2.3.5 tf.summary.text TF中使用的文本数据
tb_mnist_monitor.py---对不同变量指标的监控可视化




tensorboard 之 TF可视化的更多相关文章
- tensorboard实现tensorflow可视化
1.工程目录 2.data.input_data.py的导入 在tensorflow更新之后可以进行直接的input_data的导入 # from tensorflow.examples.tutori ...
- 利用tensorboard将数据可视化
注:代码是网上下载的,但是找不到原始出处了,侵权则删 先写出visual类: class TF_visualizer(object): def __init__(self, dimension, ve ...
- Tensorboard教程:监控指标可视化
Tensorflow监控指标可视化 觉得有用的话,欢迎一起讨论相互学习~Follow Me 参考文献 强烈推荐Tensorflow实战Google深度学习框架 实验平台: Tensorflow1.4. ...
- 使用 TensorBoard 可视化模型、数据和训练
使用 TensorBoard 可视化模型.数据和训练 在 60 Minutes Blitz 中,我们展示了如何加载数据,并把数据送到我们继承 nn.Module 类的模型,在训练数据上训练模型,并在测 ...
- Ubuntu环境下TensorBoard 可视化 不显示数据问题 No scalar data was found...(作者亲测有效)(转)
TensorBoard:Tensorflow自带的可视化工具.利用TensorBoard进行图表可视化时遇到了图表不显示的问题. 环境:Ubuntu系统 运行代码,得到TensorFlow的事件文件l ...
- 【猫狗数据集】利用tensorboard可视化训练和测试过程
数据集下载地址: 链接:https://pan.baidu.com/s/1l1AnBgkAAEhh0vI5_loWKw提取码:2xq4 创建数据集:https://www.cnblogs.com/xi ...
- TensorBoard的使用(结合线性模型)
TensorBoard是TensorFlow 的可视化工具.主要为了更方便用户理解 TensorFlow 程序.调试与优化,用户可以用 TensorBoard 来展现 TensorFlow 图像,绘制 ...
- 机器学习笔记5-Tensorflow高级API之tf.estimator
前言 本文接着上一篇继续来聊Tensorflow的接口,上一篇中用较低层的接口实现了线性模型,本篇中将用更高级的API--tf.estimator来改写线性模型. 还记得之前的文章<机器学习笔记 ...
- tensorboard基础使用
github上的tensorboard项目:https://github.com/tensorflow/tensorboard/blob/master/README.md 目录 基础介绍 基本使用 几 ...
随机推荐
- Struct2_定义拦截器并使用注解方式作用在Action的方法中
一.目的:通过在方法上加注解控制哪些方法需要登陆后才能访问 二.方式:利用拦截器判断用户是否登陆 三.实现步骤 定义配置文件struts.xml添加节点 1 2 3 4 5 6 7 8 9 1 ...
- Unity3d通用工具类之解压缩文件
今天,我们来写写c#是如何通过代码解压缩文件的. 在游戏的项目中呢,常常我们需要运用到解压缩的技术.比如,当游戏需要更新的时候,我们会从服务器中下载更新的压缩文件包. 这时候我们就需要解压文件,然后覆 ...
- iOS:菜单控制器和菜单项:UIMenuController和UIMenuItem
菜单控制器和菜单项:弹出自定义的菜单栏窗口 提示: 1. Menu所处的View必须实现 – (BOOL)canBecomeFirstResponder, 且返回YES2. Menu所处的View必须 ...
- python中子类调用父类的方法
1子类调用父类构造方法 class Animal(object): def __init__(self): print("init Animal class~") def run( ...
- subline 配置,本地项目代码下断点来调试远程项目
参考: https://my.oschina.net/ptk/blog/299464 1. 文件 tts.sublime-project 的配置如下: { "folders": [ ...
- php.in
[PHP] ;;;;;;;;;;; ; WARNING ; ;;;;;;;;;;; ; This is the default settings file for new PHP installati ...
- 拓扑排序的实现_TopoSort
拓扑排序是求一个AOV网(顶点代表活动, 各条边表示活动之间的率先关系的有向图)中各活动的一个拓扑序列的运算, 可用于測试AOV 网络的可行性. 整个算法包含三步: 1.计算每一个顶点的入度, 存入I ...
- JMeter 十二:命令行执行
参考文档:http://jmeter.apache.org/usermanual/get-started.html#non_gui 真正开始跑压力测试时,我们就不能使用GUI模式了.这时候需要采用命令 ...
- 企业建站系统MiinCMP1.0.5 标准版公布!
2014-5-6日,Juuluu公布其企业建站系统MiinCMP1.0.5 标准版,1.0.5是一款相对成熟的企业站点解决方式.执行MiinCMP1.0.5,仅仅需2M的mysql,50m的java空 ...
- c++中的对象复制
(1)this指针 this是一个隐含于每个类的成员函数的特殊指针,该指针是一个指向正在被某个成员函数操作的对象的指针. 当一个对象调用成员函数时,编译程序先将对象的地址赋给this指针,也就是说,当 ...