I often want to log python variables --as opposed to tf tensors.
In the docs it says that \"you can pass a tf.Summary protocol buffer that you populate
If you want to log a python value you have to create a placeholder that have to be fed when running the tf.Summary op.
Here's a code snipped
value_ = tf.placeholder(tf.float32, [])
summary_op = tf.scalar_summary("value_log", value_)
my_python_variable = 10
# define everything else you need...
# ...
with tf.Session() as sess:
for i in range(0, 10):
sess.run(summary_op, feed_dict={value_: my_python_variable*i})