mcibula
mcibula

Reputation: 11

No graph is shown in tensorboard

I am a Tensorflow beginner. I am following this tutorial where the code below is from:

import tensorflow as tf

x = tf.constant(1.0, name="input")
w = tf.Variable(0.8, name="weight")
y = tf.multiply(x, w, name="output")
y_ = tf.constant(0.0, name="correct_value")
loss = tf.pow(y - y_, 2, name="loss")

train_step = tf.train.GradientDescentOptimizer(learning_rate=0.025).minimize(loss)

for value in [x, w, y, y_, loss]:
    tf.summary.scalar(value.op.name, value)

summaries = tf.summary.merge_all()

with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())
    writer = tf.summary.FileWriter("/tmp/fn")
    writer.add_graph(sess.graph)

    for i in range(100):
        writer.add_summary(sess.run(summaries), i)
        sess.run(train_step)

writer.close()

Every time when I try to run Tensorboard, I get "No graph definition files were found":

Tensorboard: No graph definition files where found

I used --debug parameter and event files were found. I also used --inspect parameter which generated this:

C:\WINDOWS\system32>tensorboard --inspect --logdir="D:\tmp\fn"
======================================================================
Processing event files... (this can take a few minutes)
======================================================================

Found event files in:
D:\tmp\fn

These tags are in D:\tmp\fn:
audio -
histograms -
images -
scalars
   correct_value_1
   input_1
   loss_1
   output_1
   weight_1
tensor -
======================================================================

Event statistics for D:\tmp\fn:
audio -
graph
   first_step           0
   last_step            0
   max_step             0
   min_step             0
   num_steps            1
   outoforder_steps     []
histograms -
images -
scalars
   first_step           0
   last_step            99
   max_step             99
   min_step             0
   num_steps            100
   outoforder_steps     []
sessionlog:checkpoint -
sessionlog:start -
sessionlog:stop -
tensor -
======================================================================

I think something is wrong with my code. The code is almost same as the one in the tutorial but I have changed something because the tutorial is using other version of Tensorflow than me. I am using Tensorflow 1.3 GPU on Windows 10.

What could I be doing wrong? Thanks.

Upvotes: 0

Views: 1010

Answers (2)

mcibula
mcibula

Reputation: 11

The problem is that TensorBoard doesn't respect drive names on Windows. The problem is solved here.

Upvotes: 1

Chengji Yao
Chengji Yao

Reputation: 84

You could add the line below in your code.

tf.train.write_graph(sess.graph_def, '/tmp/fn', 'graph.pb', False)

Upvotes: 0

Related Questions