tensorflow / tensorflow/tensorboard

Mesh summaries do not respect name scopes

Open
#3,114 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

plugin:mesh type:bug
Dominant language
TypeScript
Stars
7.2k
Forks
1.7k
Avg merge
4d 22h
Merged PRs (30d)
1

Description

The docs for tensorboard.plugins.mesh.summary_v2.mesh say:

    Args:
      name: A name for this summary. The summary tag used for TensorBoard will
        be this name prefixed by any active name scopes.

But this is not accurate. Consider the following simple repro:

import tensorflow as tf
from tensorboard.plugins.mesh import summary_v2 as mesh_summary

tf.summary.create_file_writer("logs").set_as_default()

with tf.name_scope("foo"):
    with tf.name_scope("bar"):
        tf.summary.scalar("loss", 0.125, step=0)
        mesh_summary.mesh(
            "mymesh", [[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]], step=1
        )

This creates a properly scoped scalar summary, foo/bar/loss:

Screenshot of foo/bar/loss in the scalars dashboard

But the mesh summary that it creates is not scoped:

Screenshot of mymesh (no scope) in the mesh dashboard

And indeed the written data does not contain the scoped mesh tag name:

$ strings logs/*
brain.Event:2U
foo/bar/lossB
scalars@
mymesh_VERTEXB*
mesh
mymesh

This appears to be because the mesh summary code calls summary_scope
and enters its context manager but discards the yielded tag name:
https://github.com/tensorflow/tensorboard/blob/1780833b30d953509200bf9560be2ba42fabe9ff/tensorboard/plugins/mesh/summary_v2.py#L136-L141

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in tensorboard/plugins/mesh/summary_v2.py around lines 136–141, where the issue reports that summary_scope’s yielded tag name is discarded. Run the supplied Python repro and inspect the written event tags; done means the mesh summary uses the active foo/bar scope consistently with the scalar summary and the documented behavior is accurate.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.