Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorboard: graph is shown but no scalar data was found #2353

Closed
vianamp opened this issue May 13, 2016 · 18 comments
Closed

Tensorboard: graph is shown but no scalar data was found #2353

vianamp opened this issue May 13, 2016 · 18 comments

Comments

@vianamp
Copy link

vianamp commented May 13, 2016

I can see the graph, but no scalar is shown.

Environment info

Mac OS 10.11.4
Anaconda Python 2.7
Tensoflow installed from binary pip package
The output from python -c "import tensorflow as tf; print(tf.version)": 0.8.0

About the code

I am trying to log values of loss using: tf.scalar_summary('loss',loss)

I have the writer set to a particular folder: summary_writer = tf.train.SummaryWriter(LogDir, sess.graph)

After calling sess.run([optimizer, loss, learning_rate, train_prediction], feed_dict=feed_dict) I do summary_writer.flush()

What have you tried?

I can see a log file called events.out.tfevents.1463159389.Matheuss-MacBook-Pro.local in the folder I set. The file is about 16Mb big.

I call tensorboard --logdir=/Users/mviana/Desktop/tf/log/ --debug and I can verify the log dir is correct.

On the browser I can see the graph corresponding to my deep neural network, but no scalar is shown.

If I call tensorboard --inspect --logdir=/Users/mviana/Desktop/tf/log/ nothing but Starting TensorBoard 16 on port 6006 (You can navigate to http://0.0.0.0:6006) is shown in the terminal.

If I comment the line tf.scalar_summary('loss',loss) the log file size remains unchanged. So, it seems that only the graph is being logged.

@vianamp vianamp changed the title No scalar data was found Tensorboard: graph is shown but no scalar data was found May 13, 2016
@cgorman
Copy link

cgorman commented May 18, 2016

Do you have a call to tf.merge_all_summaries() (or something similar) and do you evaluate the op? See e.g. https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/mnist/fully_connected_feed.py#L151 and https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/mnist/fully_connected_feed.py#L191

@teamdandelion
Copy link
Contributor

Following on cgorman's comment: based on your session.run call, it look like you aren't actually running the summary op, or adding the output of the summary op to the SummaryWriter.

Please take a look at the example code here

@vianamp
Copy link
Author

vianamp commented May 20, 2016

Thanks guys. I was missing this:

summary = sess.run(merged, feed_dict=feed_dict)
summary_writer.add_summary(summary, step)

@kangxin
Copy link

kangxin commented May 30, 2016

I have a similar issue, except that I was running the example code:
tensorflow/tensorflow/examples/tutorials/mnist/mnist_with_summaries.py

I can see IMAGES and GRAPHS, but no EVENTS or HISTOGRAMS, with the following command:
./bazel-bin/tensorflow/tensorboard/tensorboard --logdir=/tmp/mnist_logs/

I compiled the code from source.

The following is output by adding "--debug":

./bazel-bin/tensorflow/tensorboard/tensorboard --logdir=/tmp/mnist_logs/ --debug
INFO:tensorflow:TensorBoard is in debug mode.
INFO:tensorflow:Starting TensorBoard in directory /Users/xkang/src/tensorflow
INFO:tensorflow:TensorBoard path_to_run is: {'/tmp/mnist_logs/': None}
INFO:tensorflow:Adding events from directory /tmp/mnist_logs/test
INFO:tensorflow:Constructing EventAccumulator for /tmp/mnist_logs/test
DEBUG:tensorflow:Opening a record reader pointing at /tmp/mnist_logs/test/events.out.tfevents.1464574397.Kangs-MacBook-Pro.local
DEBUG:tensorflow:No more events in /tmp/mnist_logs/test/events.out.tfevents.1464574397.Kangs-MacBook-Pro.local
INFO:tensorflow:No path found after /tmp/mnist_logs/test/events.out.tfevents.1464574397.Kangs-MacBook-Pro.local
INFO:tensorflow:Adding events from directory /tmp/mnist_logs/train
INFO:tensorflow:Constructing EventAccumulator for /tmp/mnist_logs/train
DEBUG:tensorflow:Opening a record reader pointing at /tmp/mnist_logs/train/events.out.tfevents.1464574397.Kangs-MacBook-Pro.local
INFO:tensorflow:TensorBoard is tag: 20
Starting TensorBoard 20 on port 6006
(You can navigate to http://0.0.0.0:6006)

And this is the output with "--inspect":

./bazel-bin/tensorflow/tensorboard/tensorboard --inspect --logdir=/tmp/mnist_logs/
======================================================================
Processing event files... (this can take a few minutes)
======================================================================

Found event files in:
/tmp/mnist_logs/test
/tmp/mnist_logs/train

These tags are in /tmp/mnist_logs/test:
audio -
histograms
layer1/activations
layer1/biases
layer1/pre_activations
layer1/weights
layer2/activations
layer2/biases
layer2/pre_activations
layer2/weights
images
input/image/0
input/image/1
input/image/2
input/image/3
input/image/4
input/image/5
input/image/6
input/image/7
input/image/8
input/image/9
scalars
accuracy
cross entropy
dropout_keep_probability
max/layer1/biases
max/layer1/weights
max/layer2/biases
max/layer2/weights
mean/layer1/biases
mean/layer1/weights
mean/layer2/biases
mean/layer2/weights
min/layer1/biases
min/layer1/weights
min/layer2/biases
min/layer2/weights
sttdev/layer1/biases
sttdev/layer1/weights
sttdev/layer2/biases
sttdev/layer2/weights
======================================================================

Event statistics for /tmp/mnist_logs/test:
audio -
graph -
histograms
first_step 0
last_step 990
max_step 990
min_step 0
num_steps 100
outoforder_steps []
images
first_step 0
last_step 990
max_step 990
min_step 0
num_steps 100
outoforder_steps []
scalars
first_step 0
last_step 990
max_step 990
min_step 0
num_steps 100
outoforder_steps []
sessionlog:checkpoint -
sessionlog:start -
sessionlog:stop -
======================================================================

These tags are in /tmp/mnist_logs/train:
audio -
histograms
layer1/activations
layer1/biases
layer1/pre_activations
layer1/weights
layer2/activations
layer2/biases
layer2/pre_activations
layer2/weights
images
input/image/0
input/image/1
input/image/2
input/image/3
input/image/4
input/image/5
input/image/6
input/image/7
input/image/8
input/image/9
scalars
accuracy
cross entropy
dropout_keep_probability
max/layer1/biases
max/layer1/weights
max/layer2/biases
max/layer2/weights
mean/layer1/biases
mean/layer1/weights
mean/layer2/biases
mean/layer2/weights
min/layer1/biases
min/layer1/weights
min/layer2/biases
min/layer2/weights
sttdev/layer1/biases
sttdev/layer1/weights
sttdev/layer2/biases
sttdev/layer2/weights
======================================================================

Event statistics for /tmp/mnist_logs/train:
audio -
graph
first_step 0
last_step 0
max_step 0
min_step 0
num_steps 1
outoforder_steps []
histograms
first_step 1
last_step 999
max_step 999
min_step 1
num_steps 900
outoforder_steps []
images
first_step 1
last_step 999
max_step 999
min_step 1
num_steps 900
outoforder_steps []
scalars
first_step 1
last_step 999
max_step 999
min_step 1
num_steps 900
outoforder_steps []
sessionlog:checkpoint -
sessionlog:start -
sessionlog:stop -
======================================================================

@teamdandelion
Copy link
Contributor

@kangxin That's strange. Based on the output from --inspect it looks like TensorBoard is detecting the scalar and histogram data.

Can you upload the events file so I can inspect them?

@teamdandelion teamdandelion reopened this May 30, 2016
@kangxin
Copy link

kangxin commented May 31, 2016

@danmane Thank you for quick response. I have attached the event files in
mnist_logs.zip

@teamdandelion
Copy link
Contributor

Hi @kangxin,
I've loaded your event files on my machine, and TensorBoard is displaying them properly. So it seems like the problem is not with the data itself, but with something specific to your TensorBoard or frontend.

It looks suspiciously similar to #2607, where someone reported that the demo instance at https://www.tensorflow.org/tensorboard/index.html#events is not showing them events or histograms, so maybe it is a problem affecting a particular browser/OS.

Please check if that url is working for you. If it is broken, then please tell me which browser and operating system you are using. If it is not broken, then there's probably something wrong with your particular TensorBoard, so please give me the following info:

  • Which version of TensorBoard are you using
  • What browser and operating system are you using
  • Does the issue still re-occur if you use a pip-installed TensorBoard?

@kangxin
Copy link

kangxin commented Jun 3, 2016

Hi @danmane,
Thank you for your help!
My problem seems the same as #2607. Both events and histograms are empty.
I am using Safari on OS X 10.11.5. I installed TensorFlow (0.8) from source.

I also find that Chrome could perfectly show events and histograms on Mac.

@teamdandelion
Copy link
Contributor

OK, I've fixed that at head, see: 5334468

That said, we only guarantee support for Chrome and Firefox, and performance and experience are likely to be best with Chrome.

@rasbt
Copy link
Contributor

rasbt commented Mar 18, 2017

Was just having similar problems, and double-checked multiple times that everything was set up correctly. Turned out my example ops were too "cheap" to compute, and adding a file_writer.flush() after adding the summary to the write solved the issue.

@allamtb
Copy link

allamtb commented Apr 4, 2017

@dandelionmane I have similar problems when running the example code:
tensorflow/tensorflow/examples/tutorials/mnist/mnist_with_summaries.py
I can see only GRAPHS, with the following command:
tensorboard --logdir /tmp/tensorflow/mnist/logs/mnist_with_summaries
Chrome and firefox have the same problem , tensorboard version is 1.0 . run on ubuntu.

mnist_with_summaries.tar.gz
issue

@liufuyang
Copy link

verified, adding writer.flush() solved the problem. It happened to me that locally was okay but on google cloud no scalar logs are saved. Thank you @rasbt :)

@yvaish87
Copy link

yvaish87 commented Apr 6, 2017

@liufuyang where to add writer.flush() function?

@rasbt
Copy link
Contributor

rasbt commented Apr 6, 2017

@yvaish87 I'd would be best to add it to the step where you want to update the summary, for example, sth. like

with tf.Session(graph=g) as sess:
    
    sess.run(tf.global_variables_initializer())
    
    # create FileWrite object that writes the logs
    file_writer = tf.summary.FileWriter(logdir='logs/3', graph=g)
    
    for i in range(5):
        # fetch the summary from the graph
        result, summary = sess.run([train_op, merged_summary],
                                    feed_dict={some_value: i})
        # write the summary to the log
        file_writer.add_summary(summary=summary, global_step=i)
        file_writer.flush()

@ghost
Copy link

ghost commented Jun 7, 2017

Thanks @rasbt ! I have the same issue, and either writer.flush or writer.close work for me:

Before using flush/close:

Event statistics for logs/test/2:
audio -
graph -
histograms -
images -
scalars
   first_step           0
   last_step            0
   max_step             0
   min_step             0
   num_steps            1
   outoforder_steps     []
sessionlog:checkpoint -
sessionlog:start -
sessionlog:stop -
tensor -

after:

Event statistics for logs/test/2:
audio -
graph -
histograms -
images -
scalars
   first_step           0
   last_step            24
   max_step             24
   min_step             0
   num_steps            25
   outoforder_steps     []
sessionlog:checkpoint -
sessionlog:start -
sessionlog:stop -
tensor -

@rickymf4
Copy link

rickymf4 commented Jul 5, 2017

found "Uncaught SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode"
2017-07-05 09 03 36

just add "use strict"; to the function blocks in python2.7/site-packages/tensorflow/tensorboard/dist/tf-tensorboard.html, and it works.
2017-07-05 09 12 20

@amadupu
Copy link

amadupu commented Jul 15, 2018

try to upgrade tensorflow and ensure tensboard and tensorflow are running same versions...i see these inconsitent problems if both are of different versions..

@parthvadhadiya
Copy link

self.summary_writer.flush() worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests