Most Simple Usage Of Tensorboard
来源:互联网 发布:中国网络发展史插画 编辑:程序博客网 时间:2024/05/18 14:45
Starting to learn tensorflow, some questions confused me so much. The problems are like such. Does it necessary to initialize the tensorflow.summaryFileWriter
instance? sometimes I wrote a graph and be able to access the graph, sometimes failed to do so.
I had some try. I figured some of my questions out.
Write A Most Simple Graph
import tensorflow as tfwith tf.name_scope('scp1'): a = tf.Variable(5.5,name="var0") b = a + tf.Variable(34.2)with tf.Session() as sess0: tf.summary.FileWriter('logs',sess0.graph)
save the above code to a .py
file, execute it. In the directory where the .py
file is stored, there will be a subdirectory logs
created. Open command prompt
at the dierectory contented the .py
file and execute the command tensorboard --logdir logs
. It should not be . Then, you can view the graph in chrome.tensorboard --logdir = logs
Problems I Encountered
P1
import tensorflow as tfwith tf.name_scope('scp1'): a = tf.Variable(5.5,name="var0") b = a + 34.2with tf.Session() as sess0: tf.summary.FileWriter('logs',sess0.graph)
I tried this code, I never wrote a graph. The number 3.42
in the code should be tensorflow.constant(34.2)
or tensorflow.Variable(34.2)
.
P2
import tensorflow as tfwith tf.name_scope('scp1'): a = tf.Variable(5.5,name="var0") b = a + 34.2with tf.Session() as sess0: graf = tf.summary.FileWriter('logs',sess0.graph) tf.global_variables_initializer().run()
Once, I thought the instance of tensorflow.summary.FileWriter
may also need to be initialized. I tried some code like the above. In fact, the last sentence above is not necessary.
As the name implied, it’s the the initializer for variables. The graph is not a variable. So, the initializer is not work for the graph. What’s more. The graph is just depends on the definition of the structure. For showing a graph of the structure, initializing the whole structure seems strange. These were what I perplexed with, when I found a code with tf.global_variables_initializer().run()
worked.
- Most Simple Usage Of Tensorboard
- Usage simple of shared memory
- Simple usage of ant build file build.xml
- dmtcp simple usage (checkpointing)
- Usage of Pseudocode
- Usage of MFC CRectTracker
- Usage of awk
- effective usage of strtok
- Usage of Protocol Buffer
- Usage of pmake
- Usage sample of SSL
- usage of >>>、>> and << operators
- Extensive usage of Make
- Usage of Oracle Block
- Usage of TKPROF
- Usage of Ftp
- Usage of Func delegate
- Usage of Vmstat
- 2017.10.28 C组比赛总结
- 几个常用的定制类函数
- java判断访问设备类型
- 设计模式--工厂模式
- 获取当前浏览器的当前时间,包括时、分、秒(可用作倒计时)
- Most Simple Usage Of Tensorboard
- 算法爱好者——背包问题升级版 ? 待解决
- 一台电脑同时连接多个git
- 蒜头君的排序(树状数组维护逆序对)
- Redis之Codis集群的搭建与使用-yellowcong
- android 实现男女按钮选择
- hdu 4803 贪心
- 实验:实现基于mysql的ftp虚拟用户
- Struts2+Spring+Hibernate的整合