CCPD
CCPD copied to clipboard
A preblem in file rpnet/rpnet.py
line376: loss += 0.8 * nn.L1Loss().cuda()(fps_pred[:][:2], y[:][:2])
line377: loss += 0.2 * nn.L1Loss().cuda()(fps_pred[:][2:], y[:][2:])
In the file rpnet.py ,we can know that these two lines refers the L1Loss about the detection stage.And it is obviously that the 0.8 and 0.2 is the different weight about the different element in the detection result(cx,cy,w,h), 0.8 is the weight of cx and cy ,0.2 is for w and h. But if we use the method as line376 and line377,we just give the different weight for the different example of a batch(0.8 is for the first two training data example,and 0.2 is for the remaining examples).And the correct method is as fellow: line376: loss += 0.8 * nn.L1Loss().cuda()(fps_pred[:,:2], y[:,:2]) line377: loss += 0.2 * nn.L1Loss().cuda()(fps_pred[:,2:], y[:,2:])
thank you, when I train the rpnet on cpu(pytorch1.0), the loss is always nan, and your suggestion help me
中文聊两句,第二步训练的时候把四点坐标改为了中心点和宽高,应用了这种回归方式,最终回归的位置也不精确,这样的话对旋转角度过大或者透视变形过大的情况是很不利的,是不是可以继续用四点回归呢?