I am working on the mnist classification code. Such errors continue to occur in the code below.
model = tf.keras.Sequential()
model.add(tf.keras.layers.Dense(units=10, input_dim=784, activation='softmax'))
model.compile(loss='categorical_crossentropy', optimizer=tf.optimizers.Adam(learning_rate=0.001), metrics=['accuracy'])
model.summary()
model.fit(x_train, y_train, batch_size=100, epochs=10, validation_data=(x_test, y_test))
ValueError: Input 0 of layer sequential_12 is incompatible with the layer: expected axis -1 of input shape to have value 784 but received input with shape (100, 28, 28)
Should I say "resize"? I tried to fix the number, but I couldn't solve it. I'd appreciate it if you could help me.