title: Error with input shape in keras Sequential model
body: <p>All welcome. Trying to deal with keras. I have several images saved in .npy format, as well as their labels.</p>
  
  <p>When training a model, I get an error:</p>
  
  <blockquote>
    <p>ValueError: Error when checking input: expected dense_input to have shape (135, 240) but got array with shape (240, 3)</p>
  </blockquote>
  
  <p>Which is very strange, because the shape of the submitted image is:</p>
  
  <blockquote>
    <p>(135, 240, 3)</p>
  </blockquote>
  
  <p>My class NeuralNetwork:</p>
  
  <pre><code>class NeuralNetwork():
      def __init__(self):
  
      self.model = keras.models.Sequential()
      self.model.add(keras.layers.Dense(1024, input_shape=(135, 240), activation="relu"))
      self.model.add(keras.layers.Dense(512, activation="relu"))
      self.model.add(keras.layers.Dense(9, activation="softmax"))
  
      opt = keras.optimizers.Adam()
      self.model.compile(loss="categorical_crossentropy", optimizer=opt,
                    metrics=["accuracy"])
  
      def FitModel(self, trainX, trainY):
          self.model.fit(trainX, trainY, epochs=30)
  
  
      def Predict(self, image):
          predictions = self.model.predict(image)
  
          choice = np.argmax(predictions[0])
          return choice
  </code></pre>
  
  <p>And main:</p>
  
  <pre><code>Data_Count = 7990
  
  WIDTH = 240
  HEIGHT = 135
  
  nn = NeuralNetwork()
  
  for i in range(1, DataCount+1):
  
      file_name = 'D:/TrainingData/training_data-{}.npy'.format(i)
      train_data = np.load(file_name)
  
      image = np.array([i[0] for i in train_data])[0]
      label = np.array([i[1] for i in train_data])[0]
  
      image = image / 255
  
      nn.FitModel(image, label)
  </code></pre>
  
  <p>Why she get only (240, 3), instead (135, 240)?</p>
  
  <p>Thanks in advance for the answer!</p>