Issue 1:
System information

Have I written custom code: No, I'm using MNIST Tensorboard example provided by Google.

OS Platform and Distribution: Ubuntu 16.04

Binary installation (sudo pip3 install tf-nightly-2.0-preview)

TensorFlow version (use command below): 2.0.0-dev20190405

Python version: 3.5.2

CUDA/cuDNN version: 10.0

GPU model and memory: NVIDIA GTX 1080 Ti 11GB

Describe the current behavior

My code is provided below.

Running this code gives a directory called logs. I launch Tensorboard using tensorboard --logdir=./logs

I go to localhost:6006, click the Graphs tab in my browser, and I get the message saying:

Graph: Failed Normalizing names

Tensorboard console doesn't show any errors.

I'm using the MNIST Tensorboard example provided here: https://www.tensorflow.org/tensorboard/r2/graphs

And it doesn't work in TensorFlow 2.0. Why?

Describe the expected behavior

I expect it to show the graph for the model.

Code to reproduce the issue

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from datetime import datetime
#from packaging import version

import tensorflow as tf
from tensorflow import keras

print("TensorFlow version: ", tf.__version__)

# Define the model.
model = keras.models.Sequential([
keras.layers.Flatten(input_shape=(28, 28)),
keras.layers.Dense(32, activation='relu'),
keras.layers.Dropout(0.2),
keras.layers.Dense(10, activation='softmax')
])

model.compile(
optimizer='adam',
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
(train_images, train_labels), _ = keras.datasets.fashion_mnist.load_data()
train_images = train_images / 255.0

logdir="logs/fit/" + datetime.now().strftime("%Y%m%d-%H%M%S")
tensorboard_callback = keras.callbacks.TensorBoard(log_dir=logdir)

# Train the model.
model.fit(
train_images,
train_labels,
batch_size=64,
epochs=5,
callbacks=[tensorboard_callback])

Attached file is zipped logs directory to be viewed with Tensorboard.

logs.zip

Issue 2:
Code to reproduce:

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import shutil

import tensorflow as tf

if tf.version.VERSION.startswith('1.'):
tf.compat.v1.enable_eager_execution()
tf = tf.compat.v2

LOGDIR = './logs'

def main():
shutil.rmtree(LOGDIR, ignore_errors=True)
model = tf.keras.models.Sequential([
tf.keras.layers.Dense(1, input_shape=(1,)),
])
model.compile(loss='mse', optimizer='adagrad')
callback = tf.keras.callbacks.TensorBoard(LOGDIR)
model.fit(x=[[0]], y=[[0]], callbacks=[callback])

if __name__ == '__main__':
main()

Expected behavior: Running this and then tensorboard --logdir ./logs

provides a graph visualizer that shows the Keras implementation graph.

Actual behavior: On versions of TensorFlow from 2019-03-23 onward, the

“Default” graph in the graph visualizer gives the error, “Graph: Failed

Normalizing names”.

The stack trace in the JS console is:

(index):10466 TypeError: d.list.shape.map is not a function
at d ((index):10270)
at new <anonymous> ((index):10276)
at d ((index):10286)
at (index):10285
at arrayEach ((index):80)
at Function.forEach ((index):242)
at a ((index):10285)
at arrayEach ((index):80)
at Function.forEach ((index):242)
at (index):10286

(On all versions, the batch_1 graph gives the error, “Error: The

graph is empty. […]”, and the Keras conceptual graph works fine.)

The problem appears to be due to a change in the emitted graphs, not a

change in TensorBoard; the above-described behavior occurs independent

of the TensorBoard version.

The behavior is the same under tf-nightly and tf-nightly-2.0-preview

(but removing the enable_eager_execution() call causes the code to

work fine in tf-nightly).

cc @stephanwlee; not sure whether this is a TensorBoard error or a

TensorFlow problem.