I have a feeling I’m confusing with the input shape. I have given input shape=(28,28,1)
Solved. I included a Flatten(). Thanks