In this case, target = target.reshape(-1,513,513) will create a target tensor of [63, 513, 513], which won’t match the batch size of the output of your model.
Is your target one-hot encoded?
If so, create class indices via target = torch.argmax(target, dim=1) and rerun your code.