Skip to content

Allow dynamic summary names in new summary interface #6603

Closed

Description

@foxik

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

  1. foxik commented on Jan 3, 2017

    @foxik
    ContributorAuthor

    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 loss in 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.

  2. added
    comp:tensorboard
    on Jan 8, 2017
  3. teamdandelion commented on Jun 16, 2017

    @teamdandelion

    Migrating this to tensorflow/tensorboard#59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

comp:tensorboardtype:feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions