C2W4 assignment shape error

I have all the reshaping of the data correct but when I try to use it in the net it gives me this error:

ValueError: Shapes (None, 1) and (None, 3) are incompatible

These are the shapes:

Images of training generator have shape: (27455, 28, 28, 1)Labels of training generator have shape: (27455,)Images of validation generator have shape: (7172, 28, 28, 1)Labels of validation generator have shape: (7172,)

I use categorical crossentropy loss function. And this net:

[snippet removed by mentor]

Your data has the correct shape but the loss function is incorrect. Please remember that the labels are integers in your case and not one-hot encoded. Categorical crossentropy is used when labels are one-hot encoded.

There is a variant of the loss function you can use for the problem.

On a related note, the assignment specifies the number of output classes to be 26. This means the number of units in the final dense layer must be fixed in your model as well.

Thanks. My problem was that there are 26 letters in the alphabet. I donĀ“t know why I wanted to used 3 outputs. Thanks