There are a couple of SO answers on creating a custom scalar summary in TF (here and here), but I can't find anything on creating a custom histogram summary. The documentation seems to be very lacking for custom summaries. I have a numpy array of that I'd like to make a summary of - any ideas on how?
(tf.Summary.Value has a histo field that I tried using, but it requires a tensorflow::HistogramProto; there's no documentation on that class either, so I'm at a loss on how to make it. I've tried creating a minimal failing example below).
import tensorflow as tf
import numpy as np
sess = tf.Session()
means_placeholder = tf.placeholder(tf.float32)
tf.summary.histogram('means', means_placeholder)
summaries = tf.summary.merge_all()
writer = tf.summary.FileWriter('./summaries')
means = np.random.random(10)
writer.add_summary(tf.Summary(value=[tf.Summary.Value(tag='means', histo=means)]))
This piece of code works:
The source.