title: Keras Sequential model with multiple inputs
body: <p>I am making a MLP model which takes two inputs and produces a single output.</p>
  
  <p>I have two input arrays (one for each input) and 1 output array. The neural network has 1 hidden layer with 2 neurons. Each array has 336 elements.</p>
  
  <pre><code>model0 = keras.Sequential([
  keras.layers.Dense(2, input_dim=2, activation=keras.activations.sigmoid, use_bias=True),
  keras.layers.Dense(1, activation=keras.activations.relu, use_bias=True),
  ])
  
  # Compile the neural network #
  model0.compile(
      optimizer = keras.optimizers.RMSprop(lr=0.02,rho=0.9,epsilon=None,decay=0),
      loss = 'mean_squared_error',
      metrics=['accuracy']
  )
  </code></pre>
  
  <p>I tried two ways, both of them are giving errors.</p>
  
  <pre><code>model0.fit(numpy.array([array_1, array_2]),output, batch_size=16, epochs=100)
  </code></pre>
  
  <blockquote>
    <p>ValueError: Error when checking input: expected dense_input to have shape (2,) but got array with shape (336,)</p>
  </blockquote>
  
  <p>The second way:</p>
  
  <pre><code>model0.fit([array_1, array_2],output, batch_size=16, epochs=100)
  </code></pre>
  
  <blockquote>
    <p>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 1 array(s), but instead got the following list of 2 arrays:</p>
  </blockquote>
  
  <p><a href="https://stackoverflow.com/questions/53017177/multiple-inputs-to-keras-sequential-model">Similar question</a>. But not using sequential model.</p>