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

多目标训练超参数设置问题 #13

Open
SamsaraMBJC opened this issue Nov 10, 2022 · 3 comments
Open

多目标训练超参数设置问题 #13

SamsaraMBJC opened this issue Nov 10, 2022 · 3 comments

Comments

@SamsaraMBJC
Copy link

您好,非常感谢您提供的资源和教程。我自己的数据集本来就是yolo、VOC格式的,我将其转换成DOTA格式,因此相比您提供的数据集,我的检测目标大很多,就没有做图像切割,以符合您提供的kld相关的脚本。我的数据集是多目标的,且是缺陷检测,边缘不是很明确,目标有很大的也有很小的。使用detect.py将置信度调低,发现先验框anchors产生的旋转方框,相比我的目标小很多,训练效果很差,甚至损失函数增大乃至发散。想请问一下,如何调整超参数来优化。

@lx-cly
Copy link
Owner

lx-cly commented Nov 11, 2022

loss.pytComputeLossbuild_targets,anchor 与 gt匹配是利用长宽比的比值 小于hyp['anchor_t']。如果你的anchor设置的不好,与gt差很多,可以考虑修改这次超参数,同时最好注意长宽的回归公式:pwh = (ps[:, 2:4].sigmoid() * 2) ** 2 * anchors[i]中的2也要与hyp['anchor_t']对应修改。

@lx-cly
Copy link
Owner

lx-cly commented Nov 11, 2022

yolov5运行trains.py前是会K-means聚类anchors。如果你的小目标很小的(<8个像素)的话,你可能还得考虑修改模型来,比如多输出p2层。

@SamsaraMBJC
Copy link
Author

感谢大佬回复,我再尝试一下。

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

No branches or pull requests

2 participants