title: ValueError: Input 0 of layer sequential_7 is incompatible with the layer: : expected min_ndim=4, found ndim=2. Full shape received: (None, 1024)
body: <p>New Python developer here. I looked at other similar posts here but i'm not able to get it right. Would appreciate any help.</p>
  <pre><code>print('X_train:', X_train.shape)
  print('y_train:', y_train1.shape)
  print('X_test:', X_train.shape)
  print('y_test:', y_train1.shape)
  </code></pre>
  <p>X_train: (42000, 32, 32)
  y_train: (42000,)
  X_test: (42000, 32, 32)
  y_test: (42000,)</p>
  <pre><code>from keras.models import Sequential
  from keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPooling2D
  def featuremodel() :
      model = Sequential()
      model.add(Conv2D(32, kernel_size=4, activation='relu', input_shape=(X_train.shape[0],32,64)))
      model.add(MaxPooling2D(pool_size=3))
      model.add(Conv2D(64, kernel_size=4, activation='relu'))
      model.add(Flatten())
      model.add(Dense(len(y_train[0]), activation='softmax'))
      model.compile(loss='categorical_crossentropy',
            optimizer='adadelta',      
            metrics=['acc'])
      model.summary()
      model.fit(X_train, y_train, epochs = 10, validation_data = (X_test,y_test))
  </code></pre>
  <p>return model</p>
  <p>ValueError: Input 0 of layer sequential_7 is incompatible with the layer: : expected min_ndim=4, found ndim=2. Full shape received: (None, 1024)</p>