DIoU-pytorch-detectron
DIoU-pytorch-detectron copied to clipboard
CIOU loss gives NaN values
I am using CIOU for training where there can be multiple boxes at once, and I am getting NaN by your compute_ciou() loss function.
Do u use this repo?or the others?what is the learning rate do u use?
hello,i am also getting in trouble with the NaN loss ,How can i replace step size 1/(w^2+h^2) by 1 in my pytorch code as the paper said, “And thus in our implementation, the dominator w^ 2 +h^ 2 is simply removed for stable convergence, by which the step size 1/(w^2+h^2) is replaced by 1 and the gradient direc-tion is still consistent with Eqn. (12)”
utilize with torch no grad
wrap what with torch no grad? forgive me for being a rookie , orz is there any code about this problem in your project? thanks very much
@WXP2314
......
u = d / c
v = torch.atan(w_gt / h_gt) - torch.atan(w_pred / h_pred)
with torch.no_grad():
w_pred1 = w_pred * v
h_pred1 = h_pred * v
ciou_loss =(1-iou+u+8/(math.pi**2) * (w_pred1*h_pred- h_pred1*w_pred)).sum()
Hello, which file the ciou_loss code in?
@jiangnanLZP compute_iou
function in lib/utils/net.py
@Zzh-tju thank you
w_pred1 = w_pred * v h_pred1 = h_pred * v ciou_loss =(1-iou+u+8/(math.pi**2) * (w_pred1h_pred- h_pred1w_pred)).sum()
where is this code???