title: Keras: model.fit() getting error for multiple inputs in siamese_model
body: <p>I am new to Keras and the Siamese network architecture. I have developed a Siamese network with three inputs and one output as follows. </p>
  
  <pre><code>def get_siamese_model(input_shape):
  
  
  # Define the tensors for the three input phrases
  anchor = Input(input_shape, name='anchor')
  positive = Input(input_shape, name='positive')
  negative = Input(input_shape, name='negative')
  
  # Convolutional Neural Network
  model = Sequential()
  model.add(Conv2D(64, kernel_size=(2, 2), activation='relu', input_shape=input_shape, padding='same'))
  model.add(Conv2D(32, kernel_size=(2, 2), activation='relu', padding='same'))
  model.add(Conv2D(16, kernel_size=(2, 2), activation='relu', padding='same'))
  model.add(Conv2D(8, kernel_size=(2, 2), activation='relu', padding='same'))
  model.add(Conv2D(4, kernel_size=(2, 2), activation='relu', padding='same'))
  model.add(Conv2D(2, kernel_size=(2, 2), activation='relu', padding='same'))
  model.add(Conv2D(1, kernel_size=(2, 2), activation='relu', padding='same'))
  model.add(MaxPooling2D(pool_size=(2,1)))
  model.add(Flatten())
  
  # Generate the encodings (feature vectors) for the three phrases
  anchor_out = model(anchor)
  positive_out = model(positive)
  negative_out = model(negative)
  
  # Add a customized layer to combine individual output
  concat = Lambda(lambda tensors:K.concatenate((tensors[0],tensors[1],tensors[2]),0))
  output = concat([anchor_out, positive_out, negative_out])
  
  
  # Connect the inputs with the outputs
  siamese_net = Model(inputs=[anchor,positive,negative],outputs=output)
  
  #plot the model
  plot_model(siamese_net, to_file='siamese_net.png',show_shapes=True, show_layer_names=True)
  
  #Error optimization
  siamese_net.compile(optimizer=Adam(), 
   loss=triplet_loss)
  
  # return the model
  return siamese_net
  </code></pre>
  
  <p>while using <code>model.fit()</code> I have written following code:</p>
  
  <pre><code>model = get_siamese_model(input_shape)
  X = {
      'anchor' : anchor,
      'positive' : positive,
      'negative' : negative
  }
  
  model.fit(np.asarray(X), Y)
  </code></pre>
  
  <p>I am getting following error message:</p>
  
  <pre class="lang-none prettyprint-override"><code>ValueError: Error when checking model input: 
  The list of Numpy arrays that you are passing to your model is not the size the model expected. 
  Expected to see 3 array(s), but instead got the following list of 1 arrays: [array({'anchor': array([[[[ 4.49218750e-02]...
  </code></pre>
  
  <p>Any help is appreciated. Thank you in advance.</p>