Repository navigation
Description
This is a feature request connected with pull request #5558.
The new summary interface only allows Python strings as summary names, while the old one could use string tensors.
The new behaviour is considerably less flexible. Consider the case where you have train/devel/test data split, and you want to report summaries (accuracy for example) for each dataset individually (i.e., having them in three different graphs in TensorBoard). With the old summary interface, this can be accomplished nicely:
dataset_name = tf.placeholder(tf.string, [])
summary = tf.scalar_summary(dataset_name+"/accuracy", accuracy)
...
s = session.run([summary], {dataset_name:"train" / "devel" / "test"})With the new interface, there has to be three summary nodes in the Graph to accomplish this, which makes the code repetitive and more complicated to maintain (you can create the three nodes with different name scopes, but you have to store them somewhere [a dictionary?], and if you want to use these nodes after restoring a metagraph, things become unellegant).
One possible solution is #5558 -- that pull request adds a prefix to all summary operations. The prefix is added to all summary names and can be a string tensor. That would allow reporting summaries for different datasets, while being applicable to the "new summary approach" of naming the summary operations according to the summary names (i.e., with the new approach it is not possible for name to be string tensor, but a prefix is fine).
The change #5558 is opt-in, so nobody interested in dynamic summary names is affected, while allowing much more flexible names to those interested, and I would like to see it merged.
However, there could be other approaches how the problem could be solved. Therefore, I am opening this issue for discussion and finding the best solution.
Activity
foxik commentedon Jan 3, 2017
Also see #6150, which describes related issue -- summaries cannot be named as another existing op in the graph. So for example, if there is an op
lossin the graph, it is not possible to create summary with the same name.The proposal in #6150 is to optionally pass the whole name of the summary (not just a prefix) as a string tensor. That would also solve my problem.
teamdandelion commentedon Jun 16, 2017
Migrating this to tensorflow/tensorboard#59