title: keras merge concatenate failed because of different input shape even though input shape are the same
body: <p>I am trying to concatenate 4 different layers into one layer to input into the next part of my model. I am using the Keras functional API and the code is shown below.</p>
  
  <pre><code># Concat left side 4 inputs and right side 4 inputs
  print(lc,l1_conv_net,l2_conv_net,l3_conv_net)
  left_combined = merge.Concatenate()([lc, l1_conv_net, l2_conv_net, l3_conv_net])
  </code></pre>
  
  <p>This errors occurs which says that my input shape is not the same. However, I also printed the input shape and it is seems to be the same except along the concat axis (which is the shape[1] since shape[0]=? is the number of examples in the batch).</p>
  
  <pre><code>Tensor("input_1:0", shape=(?, 6), dtype=float32) Tensor("add_3/add_1:0", shape=(?, 100), dtype=float32) Tensor("add_6/add_1:0", shape=(?, 100), dtype=float32) Tensor("add_9/add_1:0", shape=(?, 100), dtype=float32)
  
  ValueError: A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 6), (None, 7, 62), (None, 23, 62), (None, 2, 62)]
  </code></pre>
  
  <p>Coincidentally, the shape (None, 7, 62), (None, 23, 62), (None, 2, 62) is the input tensor shape for another custom keras layer which produces l1_conv_net as shown below:</p>
  
  <pre><code>l1_conv_net = build_graph_conv_net_fp_only([l1x, l1y, l1z],
                                                     conv_layer_sizes=self.conv_width,
                                                     fp_layer_size=self.fp_length,
                                                     conv_activation='relu', fp_activation='softmax')
  </code></pre>
  
  <p>So the print statement says that the shape is (?,6), (?,100) , (?,100) , (?,100) but the keras merge function reads it as [(None, 6), (None, 7, 62), (None, 23, 62), (None, 2, 62)] ? Why is this so?</p>
  
  <p>Thank you!</p>