Tensorflow细节-Tensorboard可视化-简介
先搞点基础的
注意注意注意,这里虽然很基础,但是代码应注意:
1、从writer开始后边就错开了
2、writer后可以直接接writer.close,也就是说可以:
writer = tf.summary.FileWriter("./log", graph=g)
writer.close()
import tensorflow as tf
g = tf.Graph()
with g.as_default():
input1 = tf.get_variable("input1", shape=[3], dtype=tf.float32, initializer=tf.constant_initializer([1.0, 2.0, 3.0]))
input2 = tf.get_variable("input2", shape=[3], dtype=tf.float32, initializer=tf.constant_initializer([1.0, 2.0, 3.0]))
with tf.name_scope("add_reault"):
output = tf.add_n([input1, input2], name="add")
writer = tf.summary.FileWriter("./log", graph=g)
with tf.Session(graph=g) as sess:
sess.run(tf.global_variables_initializer())
print(sess.run(output))
writer.close()
对命名空间的操作
注意最后两个命名的方式
1、 tf.get_variable不受tf.name_scope的影响
2、倒数第二个的输出是a/Variable:0
3、tf.Variable()既受tf.variable_scope()的影响也受with tf.name_scope("a"):的影响
import tensorflow as tf
with tf.variable_scope("foo"):
a = tf.get_variable("bar", [1])
print(a.name)
with tf.variable_scope("bar"):
b = tf.get_variable("bar", [1])
print(b.name)
with tf.name_scope("a"):
a = tf.Variable([1])
print(a.name)
a = tf.get_variable("b", [1])
print(a.name)
with tf.variable_scope("b",):
tf.get_variable("b", [1])
Tensorflow细节-Tensorboard可视化-简介的更多相关文章
- 学习TensorFlow,TensorBoard可视化网络结构和参数
在学习深度网络框架的过程中,我们发现一个问题,就是如何输出各层网络参数,用于更好地理解,调试和优化网络?针对这个问题,TensorFlow开发了一个特别有用的可视化工具包:TensorBoard,既可 ...
- Tensorflow 之 TensorBoard可视化Graph和Embeddings
windows下使用tensorboard tensorflow 官网上的例子程序都是针对Linux下的:文件路径需要更改 tensorflow1.1和1.3的启动方式不一样 :参考:Running ...
- 基于TensorFlow进行TensorBoard可视化
# -*- coding: utf-8 -*- """ Created on Thu Nov 1 17:51:28 2018 @author: zhen "&q ...
- Tensorflow学习笔记3:TensorBoard可视化学习
TensorBoard简介 Tensorflow发布包中提供了TensorBoard,用于展示Tensorflow任务在计算过程中的Graph.定量指标图以及附加数据.大致的效果如下所示, Tenso ...
- Windows系统,Tensorflow的Tensorboard工具细节问题
随着跟着TensorFlow视频学习,学到Tensorboard可视化工具这里的时候. 在windows,cmd里面运行,tensorboard --logdir=你logs文件夹地址 这行代码,一 ...
- 超简单tensorflow入门优化程序&&tensorboard可视化
程序1 任务描述: x = 3.0, y = 100.0, 运算公式 x×W+b = y,求 W和b的最优解. 使用tensorflow编程实现: #-*- coding: utf-8 -*-) im ...
- TensorFlow(八):tensorboard可视化
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data from tensorflow.c ...
- TensorFlow从0到1之TensorBoard可视化数据流图(8)
TensorFlow 使用 TensorBoard 来提供计算图形的图形图像.这使得理解.调试和优化复杂的神经网络程序变得很方便.TensorBoard 也可以提供有关网络执行的量化指标.它读取 Te ...
- Tensorflow 笔记 -- tensorboard 的使用
Tensorflow 笔记 -- tensorboard 的使用 TensorFlow提供非常方便的可视化命令Tensorboard,先上代码 import tensorflow as tf a = ...
随机推荐
- Python2 和 Python3区别
字符串类型不同 py3: str bytes py2: unicode str 默认解释器编码 输入输出 int int long 除法 range和xrang 模块和包 字典 keys py2:列表 ...
- Django框架第七篇(模型层)--多表操作:一对多/多对多增删改,跨表查询(基于对象、基于双下划线跨表查询),聚合查询,分组查询,F查询与Q查询
一.多表操作 一对多字段的增删改(book表和publish表是一对多关系,publish_id字段) 增 create publish_id 传数字 (publish_id是数据库显示的字段名 ...
- 【读书笔记】胡说IC
- 学java必须知道的那些queue
队列是我们学java必须接触到的知识,很多内容都和它相关,但是你真的了解它们的概念和使用方法吗?在本文,你可以获取关于queue的一切信息,希望我能够帮助你在java的学习道路上乘风破浪. 概念 队列 ...
- python递归函数和河内塔问题
关于递归函数: 函数内部调用自身的函数. 以n阶乘为例: f(n) = n ! = 1 x 2 x 3 x 4 x...x(n-1)x(n) = n x (n-1) ! def factorial(n ...
- CLRS10.1-6练习 - 用双栈实现队列
双栈实现队列算法: 分别考虑队列两种操作入队和出队,我们假设使用栈s1 s2, s1用来模拟入队,s2用来模拟出队 入队: 入队操作直接执行s1.push即可 出队: 代码实现 package hel ...
- Selenium+Java(七)Selenium对话框的处理
HTML代码如图所示: 一.alert String url = "file:///C:/Users/ex_yuhao/Desktop/index.html"; //引用IE浏览器 ...
- MOOC C++笔记(六):多态
多态 虚函数 在类的定义中,前面有virtual关键字的成员函数就是虚函数. virtual关键字只用在类定义里的函数声明中,写函数体时不用. 构造函数和静态成员函数不能是虚函数. 多态的表现形式 基 ...
- HUAWEI,H3C 三层交换机 常用命令
<HUAWEI> display ip interface brief,命令全局模式下可以查看所有端口下的ip地址及物理状态display this interface,命令用来显示当前接 ...
- JavaScript判断是否是正确数值 isNaN
NaN在JavaScript中表示不是数字 JavaScript中isNaN函数方法是返回一个 Boolean 值,指明提供的值是否是保留值 NaN (不是数字). 使用方法:isNaN(numVal ...