Error to build up model

How to fix the error “Input 0 of layer dense is incompatible with the layer: expected axis -1 of input shape to have value 150528 but received input with shape [224, 672]”.

I’d problem to build sequantial model. Hope you all will help me on this time.

train_dataset ("/home/pi/Downloads/ml_code/train_set.csv").map(decode_csv)).take(500)
eval_dataset = ("/home/pi/Downloads/ml_code/eval_set.csv").map(decode_csv)).take(50)

model =tf.keras.Sequential([
            tf.keras.layers.Flatten(input_shape = (IMG_HEIGHT, IMG_WIDTH, IMG_CHANNELS)),
            tf.keras.layers.Dense(len(CLASS_NAME), activation = "softmax")

          loss = tf.keras.losses.SparseCategoricalCrossentropy(from_logits = False),
              metrics = ['accuracy'])


tf.keras.utils.plot_model(model, show_shapes = True, show_layer_names = False, to_file = "model.jpg")

history =, validation_data = eval_dataset, epochs = 10)"first")

json.dump(history.history, open("First_History", "w"))