How to simplify Tensorboard graph with shared variables?

Viewed 894

I'm working with cifar10 model of Tensorflow. I use the inference function for both training and evaluation pipelines and share all the variables inside. My Tensorboard graph visualization looks like in the pic.

Arrows between two main columns (e.g. conv1 -> conv1_1) inside the inference scope hopefully reflect that all the conv1 variables are shared.

At the same time, node conv1_1 doesn't exist in the code. It looks like it's replicated from conv1 to separate the pipeline for my two inputs.

My question is what all of *_1 nodes in the graph exactly mean? Do scopes and functions in Tensorflow get replicated when I use them with different inputs? The main question: is there a way to hide *_1 nodes in the graph visualization because they are confusing and messy.

tensorboard graph

1 Answers

There is an issue (still open) on GitHub with a workaround https://github.com/tensorflow/tensorflow/issues/9545

from tensorflow.python.ops import variable_scope as var_scope

def simple_variable_scope(name_or_scope, reuse=None):
  """Creates a variable scope without also creating a name scope."""
  return var_scope.variable_scope(name_or_scope, reuse=reuse,
                                  auxiliary_name_scope=False)
Related