windows 环境下Tensorboard 不能显示的解决办法
2017-11-17 18:15
856 查看
今天学习tensorflow的数据流图,在做练习的时候遇见了下面的一些问题,总结如下:
AttributeError: module 'tensorflow' has no attribute 'mul'
遇到的第一个问题提示为tensorflow库中没有mul这个参数,百度后发现书本上的语法有错,应改为:
2.AttributeError: module
'tensorflow.python.training.training' has no attribute 'SummaryWriter'
这是因为在1.0版本中,tf.train.SummaryWriter已经改为tf.summary.FileWriter;因此,代码必须改为:
3.如何启动tensorboard?
一开始我按照教程的方式执行,①打开cmd;②输入tensorboard --logdir = F:\TensorBoard
然后会得到一个网址:
但是在浏览器输入这个链接(localhost:6006)的时候却不能找到程序生成的数据流图,而我在文件系统下在该文件夹里却能正常找到文件。
原因1:检查代码中的路径。
原因2:在Windows环境下涉及到路径的问题,通过看Github上大家提交的问题和解决方式,并没有使我的问题得到解决,一次偶然的尝试,结果成功了。其实方法很简单。
如果工程文件在c盘,一路
tensorboard --logdir = ./
在浏览器输入地址后:
以上,便是本人在学习TensorFlow的可视化工具tensorboard的过程中遇到的问题以及解决方法。
import tensorflow as tf a = tf.constant(5, name='input_a') b = tf.constant(3, name='input_b') c = tf.mul(a,b, name='mul_c') d = tf.add(a,b, name='add_d') e = tf.add(c,d, name='add_e') sess = tf.Session() output = sess.run(e) writer = tf.train.SummaryWriter('F:\TensorBoard',sess.graph) writer.close() sess.close()
AttributeError: module 'tensorflow' has no attribute 'mul'
遇到的第一个问题提示为tensorflow库中没有mul这个参数,百度后发现书本上的语法有错,应改为:
c = tf.multiply(a,b, name='mul_c')
2.AttributeError: module
'tensorflow.python.training.training' has no attribute 'SummaryWriter'
这是因为在1.0版本中,tf.train.SummaryWriter已经改为tf.summary.FileWriter;因此,代码必须改为:
writer = tf.summary.FileWriter('F:\TensorBoard',sess.graph)
3.如何启动tensorboard?
一开始我按照教程的方式执行,①打开cmd;②输入tensorboard --logdir = F:\TensorBoard
然后会得到一个网址:
但是在浏览器输入这个链接(localhost:6006)的时候却不能找到程序生成的数据流图,而我在文件系统下在该文件夹里却能正常找到文件。
原因1:检查代码中的路径。
原因2:在Windows环境下涉及到路径的问题,通过看Github上大家提交的问题和解决方式,并没有使我的问题得到解决,一次偶然的尝试,结果成功了。其实方法很简单。
如果工程文件在c盘,一路
cd到训练数据所在文件夹,如果在其他磁盘,先转到所在盘,再
cd到所在文件夹,然后打开
cmd,输入:
tensorboard --logdir = ./
在浏览器输入地址后:
以上,便是本人在学习TensorFlow的可视化工具tensorboard的过程中遇到的问题以及解决方法。
相关文章推荐
- windows 环境下Tensorboard 不能显示的解决办法
- windows 环境下Tensorboard 不能显示的解决办法 No dashboards are active for the current data set
- windows 环境下Tensorboard 不能显示的解决办法
- windows不能显示隐藏文件解决办法[病毒引起]
- R编辑环境中不能正常显示英语的解决办法
- ubuntu英文环境下对windows的txt显示乱码的解决办法
- R编辑环境中不能正常显示英语的解决办法
- 使用cygwin在windows上模拟unix环境,解决不能显示中文的问题
- js windows.open 不能显示页面,刷新后方可显示的解决办法
- Windows7下磁盘卷标不能显示及更改的解决办法
- 使用cygwin在windows上模拟unix环境,解决不能显示中文的问题
- js windows.open 不能显示页面,刷新后方可显示的解决办法
- 在linux下无法访问Windows下的文件,显示错误为:不能访问软件的解决办法
- Windows环境下Python v2.7.9,Notepad++编写程序中涉及中文,执行时CMD中显示乱码的解决办法
- ubuntu英文环境下对windows系统下的txt显示乱码的解决办法
- Windows下 tensorboard显示空白 以及 No graph definition files were found的问题解决
- c# asp.net 使用kindeditor在服务器上不能显示上传图片的页面等解决办法
- iphone 界面不能显示图片,文字问题的一般解决办法
- XP的系统防火墙不能用,自动更新显示灰色的解决办法
- Linux(LAMPP)下使用MySQL时不能正常显示中文的解决办法