0
votes

I used the following code in Pycharm:

import tensorflow as tf
sess = tf.Session()

a = tf.constant(value=5, name='input_a')
b = tf.constant(value=3, name='input_b')
c = tf.multiply(a,b, name='mult_c')
d = tf.add(a,b, name='add_d')
e = tf.add(c,d, name='add_e')
print(sess.run(e))

writer = tf.summary.FileWriter("./tb_graph", sess.graph)

Then, I pasted following line to the Anaconda Prompt:

tensorboard --logdir=="tb_graph"

I tried both with "" and '' as there were proposed: Tensorboard: No graph definition files were found. and it does nothing for me.

I had similar issue. The issue occurred when I specified 'logdir' folder inside single quotes instead of double quotes. Hope this may be helpful to you. egs: tensorboard --logdir='my_graph' -> Tensorboard didn't detect the graph tensorboard --logdir="my_graph" -> Tensorboard detected the graph

I checked the code on laptop with Ubuntu 16.04 and another one with Win10, so it probably isn't system-based error.

I also tried adding and removing --host=127.0.0.1 in An Prompt and checking several times both http://localhost:6006/ and http://desktop-.......:6006/.

Still same error:

No graph definition files were found. To store a graph, create a tf.summary.FileWriter and pass the graph either via the constructor, or by calling its add_graph() method. You may want to check out the graph visualizer tutorial. ....

Please tell me what is wrong in the code/propmp command?

EDIT: On Ubuntu I used the normal terminal, of course.

EDIT2: I used both = and == in command prompt

1
it works for me. tensorflow-gpu 1.10.1 tensorboard 1.10.0 ubuntu16.04 - BugKiller
@BugKiller So what do you think I should do? Should I use Anaconda interpreter in PyCharm? - mikinoqwert
make sure you indeed generated events file events.out.tfevents.1535540321???, it's 415bytes. In windows, forwardslash / may be replaced with backwardslash `, I'm not sure but you can try. In my env, single quote', double quote "` or none quote doest matter, tensorboard can handle them correctly. Oh I knew it, --logdir=tb_graph rather than --logdir==tb_graph, single equal operator = - BugKiller
@BugKillerThe files have 818 bytes. Is it wrong? - mikinoqwert
I have no idea, I may check it in my desktop if you share events file - BugKiller

1 Answers

0
votes

The answer to my question is:

1) change "./new1_dir" into ".\\new1_dir"

and

2)put full track to file to anaconda propmpt: --logdir="C:\Users\Admin\Documents\PycharmProjects\try_tb\new1_dir"

Thanks @BugKiller for your help!

EDIT: Working only on Windows for me, but still better than nothing

EDIT2: Works on Ubuntu 16.04 too