码迷,mamicode.com
首页 > 其他好文 > 详细

[转]启动tensorboard

时间:2018-07-03 11:40:37      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:setup   分享   you   on()   open   speed   lis   oca   put   

https://vivekcek.wordpress.com/tag/tensorboard-windows/

 

Visualise Computational Graphs with Tensorboard and Tensorflow

Posted by vivekcek on August 6, 2017

In this post i will show , how you can visualise computational graphs created by tensorflow bu using tensorboard.

技术分享图片

I am using visual studio for tensorflow development in windows. Refer my previous blog to setup tensor flow in windows Installing tensorflow in windows

Hope the reader has some basic understanding of tensorflow. Tensorflow execute every operation by building computational graphs. To visualize such graph we use tensorboard.

Tensorboard is a visualisation tool that will be installed as a part of tensorflow installation.

Write below code in visual studio. In this code we declare four constants, then we multiply ‘a’ and b’ after that we divide ‘c’ and ‘d’ then result of both were added to produce the final output.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import tensorflow as tf
 
a=tf.constant(6,name="a")
b=tf.constant(3,name="b")
c=tf.constant(10,name="c")
d=tf.constant(5,name="d")
 
mul=tf.multiply(a,b,name="mul")
div=tf.div(c,d,name="div")
 
addn=tf.add_n([mul,div],name="addn")
 
sess=tf.Session()
output =sess.run(addn)
print(output)
writer=tf.summary.FileWriter(‘./visual‘,sess.graph)
writer.close()
sess.close()

These line actually help us to create graphs for above computation. Here “visual” is a folder created in your running directory.

1
2
writer=tf.summary.FileWriter(‘./visual‘,sess.graph)
writer.close()

Now go to your running directory and execute below command.

1
tensorboard --logdir="visual"

技术分享图片

Now browse to the link and see the graph.

技术分享图片

[转]启动tensorboard

标签:setup   分享   you   on()   open   speed   lis   oca   put   

原文地址:https://www.cnblogs.com/wincai/p/9256836.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!