ValueError: Shapes are incompatible when fitting using ImageDataGenerator
Have you tried setting class_mode='categorical' in your generators?

I believe class_mode='sparse' works when your loss function is defined as 'sparse_categorical_crossentropy' whereas 'categorical_crossentropy' works for class_mode='categorical'.