I have batch size = 5
my network output is given by the following code Output = F.upsample(per_frame_logits, t, mode='linear')
Shape of output is = torch.Size([5, 2, 64])
Shape of target is = torch.Size([5]) (i.e. ex [1.0, 0.0, 0.0, 1.0, 1.0])
Then i pass it to following loss function loss = F.binary_cross_entropy_with_logits(output, target)
I get the following value error
raise ValueError("Target size ({}) must be the same as input size ({})".format(target.size(), input.size()))
ValueError: Target size (torch.Size([5])) must be the same as input size (torch.Size([5, 2, 64]))