title: ValueError: A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 523, 523, 32), etc
body: <p>I am trying to concatenate layers Using the following code using tensorflow , but getting an unexpected error. I am new to tensorflow </p>
  
  <pre><code>inp = Input(shape=(1050,1050,3))
  x1= layers.Conv2D(16 ,(3,3), activation='relu')(inp)
  x1= layers.Conv2D(32,(3,3), activation='relu')(x1)
  x1= layers.MaxPooling2D(2,2)(x1)
  x2= layers.Conv2D(32,(3,3), activation='relu')(x1)
  x2= layers.Conv2D(64,(3,3), activation='relu')(x2)
  x2= layers.MaxPooling2D(3,3)(x2)
  x3= layers.Conv2D(64,(3,3), activation='relu')(x2)
  x3= layers.Conv2D(64,(2,2), activation='relu')(x3)
  x3= layers.Conv2D(64,(3,3), activation='relu')(x3)
  x3= layers.Dropout(0.2)(x3)
  x3= layers.MaxPooling2D(2,2)(x3)
  x4= layers.Conv2D(64,(3,3), activation='relu')(x3)
  x4= layers.MaxPooling2D(2,2)(x4)
  x = layers.Dropout(0.2)(x4)
  o = layers.Concatenate(axis=3)([x1, x2, x3, x4, x])
  y = layers.Flatten()(o)
  y = layers.Dense(1024, activation='relu')(y)
  y = layers.Dense(5, activation='softmax')(y) 
  
  model = Model(inp, y)
  model.summary()
  model.compile(loss='sparse_categorical_crossentropy',optimizer=RMSprop(lr=0.001),metrics=['accuracy'])
  
  </code></pre>
  
  <p>The main error can be seen in the heading
  But i have provided the traceback error for reference
  And the error is </p>
  
  <pre><code>ValueError                                Traceback (most recent call last)
  &lt;ipython-input-12-31a1fcec98a4&gt; in &lt;module&gt;
       14 x4= layers.MaxPooling2D(2,2)(x4)
       15 x = layers.Dropout(0.2)(x4)
  ---&gt; 16 o = layers.Concatenate(axis=3)([x1, x2, x3, x4, x])
       17 y = layers.Flatten()(o)
       18 y = layers.Dense(1024, activation='relu')(y)
  
  /opt/conda/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py in __call__(self, inputs, *args, **kwargs)
      589           # Build layer if applicable (if the `build` method has been
      590           # overridden).
  --&gt; 591           self._maybe_build(inputs)
      592 
      593           # Wrapping `call` function in autograph to allow for dynamic control
  
  /opt/conda/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py in _maybe_build(self, inputs)
     1879       # operations.
     1880       with tf_utils.maybe_init_scope(self):
  -&gt; 1881         self.build(input_shapes)
     1882     # We must set self.built since user defined build functions are not
     1883     # constrained to set self.built.
  
  /opt/conda/lib/python3.6/site-packages/tensorflow/python/keras/utils/tf_utils.py in wrapper(instance, input_shape)
      293     if input_shape is not None:
      294       input_shape = convert_shapes(input_shape, to_tuples=True)
  --&gt; 295     output_shape = fn(instance, input_shape)
      296     # Return shapes from `fn` as TensorShapes.
      297     if output_shape is not None:
  
  /opt/conda/lib/python3.6/site-packages/tensorflow/python/keras/layers/merge.py in build(self, input_shape)
      389                        'inputs with matching shapes '
      390                        'except for the concat axis. '
  --&gt; 391                        'Got inputs shapes: %s' % (input_shape))
      392 
      393   def _merge_function(self, inputs):
  
  ValueError: A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 523, 523, 32), (None, 173, 173, 64), (None, 84, 84, 64), (None, 41, 41, 64), (None, 41, 41, 64)]
  
  </code></pre>
  
  <p>I have imported all necessary files required to run the code using <code>tensorflow.keras</code></p>