yuantn/MI-AOD

训练自己数据集时l_imgcls损失指标异常

Closed this issue · 5 comments

image
你好!训练自己的数据集,已转换成VOC格式,数据前景类别数为1,在训练过程中为何l_imgcls指标一直为0呢?望解答~

你好,你可以调试一下代码,看看在 mmdet/models/dense_head/MIAOD_head.pyl_imgcls 这个函数的训练过程中每个变量的情况有没有异常。


You can debug it and check whether there are any abnormalities in the training of each variable in function l_imgcls in mmdet/models/dense_head/MIAOD_head.py .

在利用l_imgcls计算类别交叉熵时,输入的tensor都是1,所以最后返回的损失值就是0,这个是不是跟我的输入标签只有1类有关系呢,之前我是输入两类,没有这个问题?
image

有可能是这样的吧,你可以试试在数据集中新建另一个类别,但那个类别没有对应的图像,测试一下是否还会出现这个问题。


Maybe it is right. You can try to create another class without any corresponding image in the dataset, and test whether the problem still occurs.

按照你的意思,我增加一个类别,但没有数据,i_imgcls不会为0,但随着训练的进行越来越小,这感觉是正常的趋势!所以,因为我前景只有一个类别,随意导致回归框类别损失一直为0?

我感觉原因是这样的。


I think that the reason is like this.