Based on the provided screenshot it seems you have a shape mismatch in the loss calculation and one of the tensors is being broadcasted.
Make sure both tensors (model output and target) have the same shape and rerun the code.