In that case you would have to reduce the output channels from 2048 to the number of classes, e.g. by using a conv layer with out_channels=nb_classes. The kernel size might be 1x1, but it depends on your use case, if that’s the best approach.
The target would still be wrong:

the target should have the shape [10, 256, 256] and contain values in the range [0, nb_classes-1]