GHM_Loss.pytorch
GHM_Loss.pytorch copied to clipboard
input and target mismatch
ghm_loss.py", line 55, in _custom_loss_grad return torch.sigmoid(x).detach() - target RuntimeError: The size of tensor a (2) must match the size of tensor b (208) at non-singleton dimension 1 hi, my input size is [208,2] and target size is [208], and i got error like this. could you please tell me how to fix this error?
ghm_loss.py", line 55, in _custom_loss_grad return torch.sigmoid(x).detach() - target RuntimeError: The size of tensor a (2) must match the size of tensor b (208) at non-singleton dimension 1 hi, my input size is [208,2] and target size is [208], and i got error like this. could you please tell me how to fix this error?
The shape of input and target should be same. You can refer to binary-cross-entropy-with-logits