title: 'ListWrapper' object has no attribute 'name' when plotting keras custom model
body: <p>I would like to plot the underlying topology of a custom keras model. According to this link (<a href="https://machinelearningmastery.com/visualize-deep-learning-neural-network-model-keras/" rel="nofollow noreferrer">https://machinelearningmastery.com/visualize-deep-learning-neural-network-model-keras/</a>) I thought I'd be able to just use <code>keras.utils.vis_utils.plot_model</code>, but this yielded an error.</p>
  
  <p>Here's a minimal custom model and code to reproduce the error:</p>
  
  <pre><code>import tensorflow as tf
  
  from keras.models import Model
  from keras import backend as K
  from keras.utils.vis_utils import plot_model
  
  import unittest
  
  '''
  Construct a double-layer perceptron without an activation
  '''
  
  rows = 10
  cols = 2
  
  class Model(tf.keras.Model):
      def __init__(self, hidden_topology):
          super(Model, self).__init__(name='')
          self.hidden_topology = hidden_topology
  
      def call(self, inputs):
          hidden_output = inputs
          for hidden_layer in self.hidden_topology:
              hidden_output = hidden_layer(hidden_output)
  
          return hidden_output
  
      def compute_output_shape(self, input_shape):
          return (input_shape[0][0], 1)
  
  model = Model(
      [
          tf.keras.layers.Dense(
              1,
              input_shape=((rows, cols), ),
              use_bias=True,
              kernel_initializer=tf.constant_initializer(1.0),
              bias_initializer=tf.constant_initializer(0.0)),
          tf.keras.layers.Dense(
              1,
              input_shape=((rows, cols), ),
              use_bias=True,
              kernel_initializer=tf.constant_initializer(1.0),
              bias_initializer=tf.constant_initializer(0.0))
      ])
  
  
  test_data = np.reshape(range(rows*cols), (rows,cols)).astype(np.float32)
  top = model.call(test_data)
  
  #plot_model(top, to_file='model_plot.png')#, show_shapes=True, show_layer_names=True)
  plot_model(model, to_file='model_plot.png')#, show_shapes=True, show_layer_names=True)
  </code></pre>
  
  <p>This yields the following error:</p>
  
  <pre><code>AttributeErrorTraceback (most recent call last)
  &lt;ipython-input-3-b73c347c7b0a&gt; in &lt;module&gt;()
       49 # top = model.call(test_data)
       50 
  ---&gt; 51 plot_model(model, to_file='model_plot.png')#, show_shapes=True, show_layer_names=True)
       52 
       53 # def call(self, inputs):
  
  /package/python-2.7.15/lib/python2.7/site-packages/keras/utils/vis_utils.pyc in plot_model(model, to_file, show_shapes, show_layer_names, rankdir, expand_nested, dpi)
      238     """
      239     dot = model_to_dot(model, show_shapes, show_layer_names, rankdir,
  --&gt; 240                        expand_nested, dpi)
      241     _, extension = os.path.splitext(to_file)
      242     if not extension:
  
  /package/python-2.7.15/lib/python2.7/site-packages/keras/utils/vis_utils.pyc in model_to_dot(model, show_shapes, show_layer_names, rankdir, expand_nested, dpi, subgraph)
      104 
      105         # Append a wrapped layer's label to node's label, if it exists.
  --&gt; 106         layer_name = layer.name
      107         class_name = layer.__class__.__name__
      108 
  
  AttributeError: 'ListWrapper' object has no attribute 'name'
  </code></pre>
  
  <p>I also tried the commented out line, to no avail.</p>
  
  <p>How can I visualise this topology? I'm using tensorflow 2.0.0</p>