title: Input 0 of layer "dense_24" is incompatible with layer: expected axis -1of input shape to have value 12, but received input with shape (None, 12, 6)
body: <p>I'm trying to train my neural network model but there is error showing and i don't know how to solve these kind of errors.
  Is there anyone who can help me out of this big error.</p>
  <pre><code>NN_architecture.add(Dense(input_shape=(12,), units=8, activation='relu'))
  NN_architecture.add(Dense(units=8, activation='relu'))
  NN_architecture.add(Dense(units=3, activation='softmax'))
  NN_architecture.compile(loss = 'categorical_crossentropy', optimizer='adam', metrics = ['accuracy'])
  NN_architecture.summary()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/cw0Vs.png" rel="nofollow noreferrer">enter image description here</a></p>
  <pre><code>aa=NN_architecture.fit(train_feature, train_output, batch_size=128, epochs=15)
  
  Epoch 1/15
  WARNING:tensorflow:Model was constructed with shape (None, 12) for input KerasTensor(type_spec=TensorSpec(shape=(None, 12), dtype=tf.float32, name='dense_24_input'), name='dense_24_input', description=&quot;created by layer 'dense_24_input'&quot;), but it was called on an input with incompatible shape (None, 12, 6).
  
  [enter image description here][2]
  
      ValueError: Exception encountered when calling layer &quot;sequential_1&quot; (type Sequential).
      
      Input 0 of layer &quot;dense_24&quot; is incompatible with the layer: expected axis -1of input shape to have value 12, but received input with shape (None, 12, 6)
      
      Call arguments received:
        • inputs=tf.Tensor(shape=(None, 12, 6), dtype=float32)
        • training=True
        • mask=None
  </code></pre>