Based on the error message it seems that the model outputs a tensor in the shape [1, 19], which would correspond to the 19 classes you are dealing with, while the target has the shape [1, 23].
I don’t know, how you’ve manipulated the model to output bounding boxes, but the current output seems to only contain the class predictions, so you would most likely have to fix the target shape (are you appending the bbox coordinates to the clas tensor?).