My input label size is torch.size([30, 2, 96, 96, 96])
My labels size is torch.size([30, 96, 96, 96])  ,Im feeding them to my loss function which goes like this
loss = F.binary_cross_entropy(F.sigmoid(output),labels,torch.FloatTensor(CLASS_WEIGHTS).cuda())

when i run this though i get
Value error:Target and input must have the same number of elements.target nelement(26542080) != input nelement(53084160)

Im a little confused here, i get the input value is twice the target value because it multiplies [30,96,96] by num classes,But im not sure why is that, and how to rectify it, Any suggestions will be helpful,Thanks in advance.