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 with your own data" but there is no docs for tf.Summary and i could not figure out how to use it.
tf.Summary
Anyone knows how to create a Scalar summary this way?
You can create a tf.Summary object in your Python program and write it to the same tf.summary.FileWriter object that takes your TensorFlow-produced summaries using the SummaryWriter.add_summary() method.
tf.summary.FileWriter
SummaryWriter.add_summary()
The tf.Summary class is a Python protocol buffer wrapper for the Summary protocol buffer. Each Summary contains a list of tf.Summary.Value protocol buffers, which each have a tag and a either a "simple" (floating-point scalar) value, an image, a histogram, or an audio snippet. For example, you can generate a scalar summary from a Python object as follows:
Summary
tf.Summary.Value
writer = tf.train.SummaryWriter(...) value = 37.0 summary = tf.Summary(value=[ tf.Summary.Value(tag="summary_tag", simple_value=value), ]) writer.add_summary(summary)
2.1m questions
2.1m answers
60 comments
56.8k users