I created a simple TensorFlow model (no convolution layers) using the MNIST dataset. I initially used SparseCategoricalCrossentropy loss function and it worked fin
SparseCategoricalCrossentropy