It expects the target to have dimensions (60,10), but you provide them as (60,2,10).

I think you have to give your targets as 2D map where each pixel has the value of the appropriate class (or just a vector with the correct classes, depending on what you’re doing)

i have posted my whole model in code.
Actually every image belongs to one of the ten classes for two categories.(i.e. the labels size is [2,10], one class in each of the ten classes.)
And my model gives and output of (batch_size,20),Therefore i am reshaping it to (batch_size,2,10) so that is matches with the dimension of the label.
(the batch size is 60).