title: Why layer number in keras does not start from 1 after deleting and recreating model?
body: <p>I am new to keras, I am trying to create a CNN model. I created one sequential model as follows-</p>
  
  <pre><code>model = models.Sequential()
  model.add(layers.Conv2D(32, (5, 5), activation='relu', input_shape=(150, 150, 3)))
  model.add(layers.MaxPooling2D(pool_size=(2, 2), strides=(2, 2)))
  model.add(layers.Conv2D(64, (3, 3), activation='relu'))
  model.add(layers.MaxPooling2D((2, 2)))
  model.add(layers.Conv2D(64, (3, 3), activation='relu'))
  model.add(layers.MaxPooling2D((2, 2)))
  print(model.summary())
  </code></pre>
  
  <p>I get the summary as follows-</p>
  
  <blockquote>
    <hr>
  
  <pre><code>Layer (type)                 Output Shape              Param #   
  =================================================================
  conv2d_1 (Conv2D)            (None, 146, 146, 32)      2432      
  _________________________________________________________________
  max_pooling2d_1 (MaxPooling2 (None, 73, 73, 32)        0         
  _________________________________________________________________
  conv2d_2 (Conv2D)            (None, 71, 71, 64)        18496     
  _________________________________________________________________
  max_pooling2d_2 (MaxPooling2 (None, 35, 35, 64)        0         
  _________________________________________________________________
  conv2d_3 (Conv2D)            (None, 33, 33, 64)        36928     
  _________________________________________________________________
  max_pooling2d_3 (MaxPooling2 (None, 16, 16, 64)        0         
  =================================================================
  Total params: 57,856
  Trainable params: 57,856
  Non-trainable params: 0
  _________________________________________________________________
  </code></pre>
  </blockquote>
  
  <p>After this, I delete the model using <code>del model</code> and again create it using above code, I get the summary as follows-</p>
  
  <blockquote>
    <hr>
  
  <pre><code>Layer (type)                 Output Shape              Param #   
  =================================================================
  conv2d_4 (Conv2D)            (None, 146, 146, 32)      2432      
  _________________________________________________________________
  max_pooling2d_4 (MaxPooling2 (None, 73, 73, 32)        0         
  _________________________________________________________________
  conv2d_5 (Conv2D)            (None, 71, 71, 64)        18496     
  _________________________________________________________________
  max_pooling2d_5 (MaxPooling2 (None, 35, 35, 64)        0         
  _________________________________________________________________
  conv2d_6 (Conv2D)            (None, 33, 33, 64)        36928     
  _________________________________________________________________
  max_pooling2d_6 (MaxPooling2 (None, 16, 16, 64)        0         
  =================================================================
  Total params: 57,856
  Trainable params: 57,856
  Non-trainable params: 0
  _________________________________________________________________
  </code></pre>
  </blockquote>
  
  <p>So, why is this summary showing layer numbering from <strong>conv2d_4</strong>, it should be from <strong>conv2d_1</strong>?</p>
  
  <p>Even if I create another model-</p>
  
  <pre><code>model_2 = models.Sequential()
  model_2.add(layers.Conv2D(32, (5, 5), activation='relu', input_shape=(150, 150, 3)))
  model_2.add(layers.MaxPooling2D(pool_size=(2, 2), strides=(2, 2)))
  model_2.add(layers.Conv2D(64, (3, 3), activation='relu'))
  model_2.add(layers.MaxPooling2D((2, 2)))
  model_2.add(layers.Conv2D(64, (3, 3), activation='relu'))
  model_2.add(layers.MaxPooling2D((2, 2)))
  print(model_2.summary())
  </code></pre>
  
  <p>I get numbering starting after the final layer number of previous model-</p>
  
  <blockquote>
    <hr>
  
  <pre><code>Layer (type)                 Output Shape              Param #   
  =================================================================
  conv2d_7 (Conv2D)            (None, 146, 146, 32)      2432      
  _________________________________________________________________
  max_pooling2d_7 (MaxPooling2 (None, 73, 73, 32)        0         
  _________________________________________________________________
  conv2d_8 (Conv2D)            (None, 71, 71, 64)        18496     
  _________________________________________________________________
  max_pooling2d_8 (MaxPooling2 (None, 35, 35, 64)        0         
  _________________________________________________________________
  conv2d_9 (Conv2D)            (None, 33, 33, 64)        36928     
  _________________________________________________________________
  max_pooling2d_9 (MaxPooling2 (None, 16, 16, 64)        0         
  =================================================================
  Total params: 57,856
  Trainable params: 57,856
  Non-trainable params: 0
  _________________________________________________________________
  </code></pre>
  </blockquote>