Keras: Dimension Error with Sparse Categorical Crossentropy
I thing you've misunderstood what the difference between categorical_crossentropy and sparse_categorical_crossentropy is. The sparse part doesn't refer to the sparsity of the data but the format of the labels.


If your labels are one-hot encoded: use categorical_crossentropy
If your labels are encoded as integers: use sparse_categorical_crossentropy