tensorflow / tensorflow/tensorboard
Graph: show output nodes of a model if it is not connected to any other nodes
Open
Nobody has claimed this yet.
plugin:graph
type:bug
- Dominant language
- TypeScript
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 1
Description
Version: tensorflow 2.0.0a0
Python code for bug reproduction:
import numpy as np
import tensorflow as tf
print(tf.__version__)
input1 = tf.keras.Input(shape=[3, 4])
lstm = tf.keras.layers.GRU(1, return_state=True)
[output1, output2] = lstm(input1)
dense = tf.keras.layers.Dense(1)
output1 = dense(output1)
model = tf.keras.Model(inputs=input1, outputs=[output1, output2])
model.compile(loss=['mean_squared_error', 'mean_squared_error'],
optimizer='sgd')
num_examples = 8
xs1 = np.zeros([num_examples, 3, 4])
ys1 = np.ones([num_examples, 1])
ys2 = np.zeros([num_examples, 1])
model.fit(xs1, [ys1, ys2], epochs=10,
callbacks=[tf.keras.callbacks.TensorBoard('/tmp/foo6
Then start tensorboard:
tensorboard --logdir /tmp/foo6
Navigate to the Graph dashboard and select tag "keras". The graph looks like the following:

This graph is misleading in a number of ways:
- It doesn't indicate that the model has two outputs (
output1andoutput2in the code) - It doesn't indicate that the GRU (
unified_gru) layer has two outputs - It seems to indicate that both outputs of the GRU layer go into the dense layer, whereas in reality only the first one does and the second one is directly routed to the output of the entire model.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the Python reproduction with TensorBoard and inspect the Graph dashboard's "keras" tag. Trace how the displayed graph represents the model's output nodes and the GRU's two outputs. Done means the graph distinguishes both model outputs and shows that only the first GRU output feeds the dense layer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- keras, python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100