Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gen0924 opened this issue Jun 24, 2021 · 5 comments
Closed

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

gen0924 opened this issue Jun 24, 2021 · 5 comments
Labels
individual Individual problem and need

Comments

@gen0924
Copy link

gen0924 commented Jun 24, 2021

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

@yuantn
Copy link
Owner

yuantn commented Jun 24, 2021

你好,你可以调试一下代码,看看在 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 .

@gen0924
Copy link
Author

gen0924 commented Jun 24, 2021

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

@yuantn
Copy link
Owner

yuantn commented Jun 24, 2021

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


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.

@gen0924
Copy link
Author

gen0924 commented Jun 24, 2021

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

@yuantn
Copy link
Owner

yuantn commented Jun 25, 2021

我感觉原因是这样的。


I think that the reason is like this.

@yuantn yuantn added the individual Individual problem and need label Jun 25, 2021
@gen0924 gen0924 closed this as completed Jul 22, 2021
This was referenced Aug 6, 2021
yuantn added a commit that referenced this issue Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
individual Individual problem and need
Projects
None yet
Development

No branches or pull requests

2 participants