I am new in tensoflow and I want to adapt the MNIST tutorial https://www.tensorflow.org/tutorials/layers with my own data (images of 40x40). This is my model function :
I resolved it changing from sparse_categorical_crossentropy to categorical_crossentropy and is now running fine.
sparse_categorical_crossentropy
categorical_crossentropy