Open dadafan2343 opened 3 years ago
Hi, have you solved the problem, I met the same error...
weights
means the weight values to be applied to each pixel of the label(width, hight)
So, I tried below to fix the error
weights = weights.repeat(19,1,1,1).transpose(0,1) ## add this line
loss = -torch.sum((torch.pow(prob, 2)*weights)[mask]) / (batch_size*self.num_class)
Is it right?? How do you think about it??
Hello,
Thanks for your contribution and work. But I have the problem of "IW_MaxSquareloss":
"IW_MaxSquareloss" error: for: loss = -torch.sum((torch.pow(prob, 2)weights)[mask]) / (batch_sizeself.num_class)
torch.pow(prob, 2) and weights
RuntimeError: The size of tensor a (4) must match the size of tensor b (2) at non-singleton dimension 1