1、add saclar and histogram

tf.summary.scalar('mean', mean)
tf.summary.histogram('histogram', var)

2、 sess-op

merged = tf.summary.merge_all()

3、writer init

train_writer = tf.summary.FileWriter(FLAGS.summaries_dir + '/train',
sess.graph)

4、sess run & write to file

summary, acc = sess.run([merged, accuracy], feed_dict=feed_dict(False))
test_writer.add_summary(summary, i)

举例:

import tensorflow as tf

k = tf.placeholder(tf.float32)

# Make a normal distribution, with a shifting mean
mean_moving_normal = tf.random_normal(shape=[1000], mean=(5*k), stddev=1)
# Record that distribution into a histogram summary
tf.summary.histogram("normal/moving_mean", mean_moving_normal) # Setup a session and summary writer
sess = tf.Session()
writer = tf.summary.FileWriter("/tmp/histogram_example") summaries = tf.summary.merge_all() # Setup a loop and write the summaries to disk
N = 400
for step in range(N):
k_val = step/float(N)
summ = sess.run(summaries, feed_dict={k: k_val})
writer.add_summary(summ, global_step=step)

查看

tensorboard --logdir=/tmp/histogram_example

https://tensorflow.google.cn/guide/tensorboard_histograms

https://tensorflow.google.cn/guide/summaries_and_tensorboard

tensorflow 训练之tensorboard使用的更多相关文章

  1. 使用TensorFlow训练自己的语音识别AI

    这次来训练一个基于CNN的语音识别模型.训练完成后,我们将尝试将此模型用于Hotword detection. 人类是怎样听懂一句话的呢?以汉语为例,当听到"wo shi"的录音时 ...

  2. 目标检测 的标注数据 .xml 转为 tfrecord 的格式用于 TensorFlow 训练

    将目标检测 的标注数据 .xml 转为 tfrecord 的格式用于 TensorFlow 训练. import xml.etree.ElementTree as ET import numpy as ...

  3. 自己搞了20万张图片100个分类,tensorflow训练23万次后。。。。。。

    自己搞了20万张图片100个分类,tensorflow训练23万次后...... 我自己把训练用的一张图片,弄乱之后做了一个预测 100个汉字,20多万张图片,tensorflow CNN训练23万次 ...

  4. tensorflow训练了10万次,运行完毕,对这个word2vec终于有点感觉了

    tensorflow训练了10万次,运行完毕,对这个word2vec终于有点感觉了 感觉它能找到词与词之间的关系,应该可以用来做推荐系统.自动摘要.相关搜索.联想什么的 tensorflow1.1.0 ...

  5. 2、TensorFlow训练MNIST

    装载自:http://www.tensorfly.cn/tfdoc/tutorials/mnist_beginners.html TensorFlow训练MNIST 这个教程的目标读者是对机器学习和T ...

  6. tensorflow训练验证码识别模型

    tensorflow训练验证码识别模型的样本可以使用captcha生成,captcha在linux中的安装也很简单: pip install captcha 生成验证码: # -*- coding: ...

  7. TensorFlow训练MNIST报错ResourceExhaustedError

    title: TensorFlow训练MNIST报错ResourceExhaustedError date: 2018-04-01 12:35:44 categories: deep learning ...

  8. TensorFlow.训练_资料(有视频)

    ZC:自己训练 的文章 貌似 能度娘出来很多,得 自己弄过才知道哪些个是坑 哪些个好用...(在CSDN文章的右侧 也有列出很多相关的文章链接)(貌似 度娘的关键字是"TensorFlow ...

  9. TensorFlow 训练好模型参数的保存和恢复代码

    TensorFlow 训练好模型参数的保存和恢复代码,之前就在想模型不应该每次要个结果都要重新训练一遍吧,应该训练一次就可以一直使用吧. TensorFlow 提供了 Saver 类,可以进行保存和恢 ...

随机推荐

  1. gittalk报错Error

    最近通过github和jekyll搭了一个博客,申请使用了gittalk的评论. 但是博客的页面一直报Error:Not found,如下 发现是gittalk中的信息填写错了,name随便写:Hom ...

  2. MySQL 文章目录

    MySQL系列: MySQL CREATE TABLE语法 MySQL 复制表结构 MySQL 对比数据库表结构 MySQL 处理插入过程中的主键唯一键重复值办法 MySQL 启动原理剖析 MySQL ...

  3. cassandra读源码---Streaming

    前言 cassandra的很多过程需要网络传输模块,需要在各个节点直接发送文件.包括加入节点,删除节点引起的不同节点的负责ring环的key值发生了变化,导致sstable需要在各个节点中移动. 整体 ...

  4. 【机器学习】--LDA初始和应用

    一.前述 LDA是一种 非监督机器学习 技术,可以用来识别大规模文档集(document collection)或语料库(corpus)中潜藏的主题信息.它采用了词袋(bag of words)的方法 ...

  5. golang中Context的使用场景

    golang中Context的使用场景 context在Go1.7之后就进入标准库中了.它主要的用处如果用一句话来说,是在于控制goroutine的生命周期.当一个计算任务被goroutine承接了之 ...

  6. .NET Core微服务之基于Steeltoe使用Eureka实现服务注册与发现

    Tip: 此篇已加入.NET Core微服务基础系列文章索引 =>  Steeltoe目录快速导航: 1. 基于Steeltoe使用Spring Cloud Eureka 2. 基于Steelt ...

  7. 『集群』005 Slithice 基于 集群 的 自动容错

    Slithice 基于 集群 的 自动容错 Slithice容错概述: Slithice 支持 非集群 的 独立服务端: 支持 基于 中央服务器 的 集群服务端: 支持 基于 自定义配置 的 集群服务 ...

  8. [翻译 EF Core in Action] 1.5 关于NoSql

    Entity Framework Core in Action Entityframework Core in action是 Jon P smith 所著的关于Entityframework Cor ...

  9. k邻近算法(KNN)实例

    一 k近邻算法原理 k近邻算法是一种基本分类和回归方法. 原理:K近邻算法,即是给定一个训练数据集,对新的输入实例,在训练数据集中找到与该实例最邻近的K个实例,这K个实例的多数属于某个类,就把该输入实 ...

  10. 菜鸟先飞C#学习总结(一)

    一.第一个程序Hellow Word using System; //using 关键字用于在程序中包含 System 命名空间. 一个程序一般有多个 using 语句. using System.C ...