I am currently learning about Keras and have a problem with the input shape of a dense layer.I am currently trying to the mnist dataset.I understand that the input_shape for the train images is (60000,28,28) also i understand that keras ignores the first dimension as it is the batch size hence the input shape entered in the dense model should be (28,28) but when putting that i get an error yet when i put input shape of(784,) the model runs.Could someone please explain why is that so
(train_images, train_labels), (test_images, test_labels) =
mnist.load_data()
print(train_images.shape)
network = models.Sequential()
network.add(layers.Dense(512, activation='relu', input_shape=(28,28)))
network.add(layers.Dense(10, activation='softmax'))