title: Tensorflow Keras - AttributeError: Layer features has no inbound nodes
body: <p>Tensorflow version : 1.11.0</p>
  
  <p>I am trying to use TensorBoard with Tensorflow keras model for projector visualisation. 
  I am getting AttributeError: Layer features has no inbound nodes.
  I am not sure why I get this error in below simple code. I indeed google the error but I could not find right solution to fix it. </p>
  
  <pre><code>from os import makedirs
  from os.path import exists, join
  import tensorflow as tf
  mnist = tf.keras.datasets.mnist
  
  import numpy as np
  
  
  (x_train, y_train),(x_test, y_test) = mnist.load_data()
  x_train, x_test = x_train / 255.0, x_test / 255.0
  
  model = tf.keras.models.Sequential([
    tf.keras.layers.Flatten(),
    tf.keras.layers.Dense(512, activation=tf.nn.relu),
    tf.keras.layers.Dropout(0.2),
    tf.keras.layers.Flatten(),
    tf.keras.layers.Dense(10, activation=tf.nn.relu, name='features'),
    tf.keras.layers.Dense(10, activation=tf.nn.softmax)
  ])
  model.compile(optimizer='adam',
                loss='sparse_categorical_crossentropy',
                metrics=['accuracy'])
  
  log_dir = "./logs"
  with open(join(log_dir, 'metadata.tsv'), 'w') as f:
      np.savetxt(f, y_test)
  
  from tensorflow.keras.callbacks import TensorBoard
  
  tf_board_callback = TensorBoard(
                              log_dir=log_dir,
                              batch_size=32,
                              embeddings_freq=1,
                              embeddings_layer_names=['features'],
                              embeddings_metadata='metadata.tsv',
                              embeddings_data=x_test
                          )
  
  model.fit(x_train, y_train, epochs=5, callbacks=[tf_board_callback])
  </code></pre>