I'm trying to a simple plot on tensorboard, just like they have it on homepage, something like this:
To understand how this is working I've wrote the following :
import tensorflow as tf
import numpy as np
x = tf.placeholder('float',name='X')
y= tf.placeholder('float',name='y')
addition = tf.add(x,y)
with tf.Session() as sess:
for i in range(100):
var1= np.random.rand()
var2= np.random.rand()
print(var1,var2)
tf.summary.scalar('addition',sess.run(addition, feed_dict={x:var1,y:var2}))
writer = tf.summary.FileWriter('Graphs',sess.graph)
while I can see the graph, I can't see any scalar value. Can any explain to me what I'm doing wrong here? PS: I've run all official examples and they are all working but I need to understand this example to be able to work with it. Thanks for any help !
Update
after run @dv3 code the program crashs. and here is what I get:
InvalidArgumentError: You must feed a value for placeholder tensor 'input/x-input' with dtype float
[[Node: input/x-input = Placeholder[dtype=DT_FLOAT, shape=[], _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
During handling of the above exception, another exception occurred:
InvalidArgumentError Traceback (most recent call last)
<ipython-input-5-5cbd77e71936> in <module>()
14 var2= np.random.rand()
15 print(var1,var2)
---> 16 add, s_ = sess.run([addition, summary_op], feed_dict={x:var1,y:var2})
17 writer.add_summary(s_, i)