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

Update PaddleDetector.cs #91

Merged
merged 1 commit into from
Apr 30, 2024
Merged

Update PaddleDetector.cs #91

merged 1 commit into from
Apr 30, 2024

Conversation

LuGuangguang
Copy link
Contributor

防止当识别到的ClassID大于模型中预设的种类时,导致Config.LabelList 索引溢出的问题。

防止当识别到的ClassID大于模型中预设的种类时,导致Config.LabelList 索引溢出的问题
@LuGuangguang
Copy link
Contributor Author

表现在PaddleDetection 控制台异常如下
1714354357786

@sdcb
Copy link
Owner

sdcb commented Apr 30, 2024

一般这种情况应该是模型不正确吧?

@LuGuangguang
Copy link
Contributor Author

LuGuangguang commented Apr 30, 2024

一般这种情况应该是模型不正确吧?

一般出现这种情况是在训练模型的时候设置的配置文件的num_classes的值与label_list.txt里面的标签不一致。实际训练了3个标签,但是在应用模型时,还会尝试继续往下进行,导致了索引溢出的情况。
所以我想的是,在应用模型的时候,以label_list.txt 里面的类别个数为准。classId 和 label_list取较小的一个。
image
因为上面的classId是6,所以在目标检测的时候会一直尝试识别6个类,但label_list只有3个,所以就溢出了
1714457061228

@sdcb
Copy link
Owner

sdcb commented Apr 30, 2024

明白了,这么说也有道理

@sdcb sdcb merged commit f0cf603 into sdcb:master Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants