Tensorboard:未找到图形定义文件. [英] Tensorboard: No graph definition files were found.

查看:42
本文介绍了Tensorboard:未找到图形定义文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 Python 代码中我执行train_writer = tf.summary.FileWriter(TBOARD_LOGS_DIR)train_writer.add_graph(sess.graph)

In my Python code I execute train_writer = tf.summary.FileWriter(TBOARD_LOGS_DIR) train_writer.add_graph(sess.graph)

我可以看到在 E:\progs\tensorboard_logs 中创建的 1.6MB 文件(没有其他文件)但是当我执行张量板 --logdir=E:\progs\tensorboard_logs它加载,但说:没有找到图形定义文件."当我点击图表时.此外,运行 tensorboard --inspect --logdir=E:\progs\tensorboard_logs显示在以下位置找到事件文件:E:\progs\tensorboard_logs

I can see 1.6MB file created in E:\progs\tensorboard_logs (and no other file) but then when I execute tensorboard --logdir=E:\progs\tensorboard_logs it loads, but says: "No graph definition files were found." when I click on Graph. Additionally, running tensorboard --inspect --logdir=E:\progs\tensorboard_logs displays Found event files in: E:\progs\tensorboard_logs

这些标签在 E:\progs\tensorboard_logs 中:声音的 -直方图 -图片 -

These tags are in E:\progs\tensorboard_logs: audio - histograms - images -

E:\progs\tensorboard_logs 的事件统计信息:声音的 -图形第一步 0最后一步 0最大步长 0最小步长 0num_steps 1outoforder_steps []直方图 -图片 -标量 -会话日志:检查点 -会话日志:开始 -

Event statistics for E:\progs\tensorboard_logs: audio - graph first_step 0 last_step 0 max_step 0 min_step 0 num_steps 1 outoforder_steps [] histograms - images - scalars - sessionlog:checkpoint - sessionlog:start -

这是 TF 1.01 左右,在 Windows 10 上.

This is TF 1.01 or so, on Windows 10.

推荐答案

在处理图的 Tensorflows 中,分为三个部分:1)创建图形2)将图形写入事件文件3) 在张量板中可视化图表

In Tensorflows dealing with graphs, there are three parts: 1) creating the graph 2) Writing the graph to event file 3) Visualizing the graph in tensorboard

a = tf.constant(5, name="input_a")
b = tf.constant(3, name="input_b")

c = tf.multiply(a,b, name="mul_c")
d = tf.add(a,b, name="add_d")

e = tf.add(c,d, name="add_e")

sess = tf.Session() 

sess.run(c) <--check, value should be 15
sess.run(d) <--check, value should be 8
sess.run(e) <--check, value should be 23

在事件文件中写入图表

 writer = tf.summary.FileWriter('./tensorflow_examples', sess.graph)

指定一个目录(在这种情况下,目录是tensorflow_examples)非常重要,事件文件将写入其中.writer = tf.summary.FileWriter('./', sess.graph) 对我不起作用,因为 shell 命令 => tensorboard --logdir 需要一个目录名.

It is very important to specify a directory(in this case, the directory is tensorflow_examples), where the event file will be written to. writer = tf.summary.FileWriter('./', sess.graph) didnt work for me, because the shell command => tensorboard --logdir expects a directory name.

执行此步骤后,请验证是否已在指定目录中创建事件文件.

After executing this step, verify if event file has been created in specified directory.

打开终端(bash),在工作目录类型下:张量板 --logdir='tensorflow_examples' --host=127.0.0.1

Open terminal(bash), under working directory type: tensorboard --logdir='tensorflow_examples' --host=127.0.0.1

然后在 http://127.0.0.1:6006/http://localhost/6006 现在 tensorboard 成功显示图表.

Then open a new browser in http://127.0.0.1:6006/ or http://localhost/6006 and now tensorboard shows the graph successfully.

这篇关于Tensorboard:未找到图形定义文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆