Skip to content

DBNet 混合精度训练 不收敛 #12445

Closed Answered by andyjiang1116
Jverson asked this question in Q&A
Discussion options

You must be logged in to vote

原因:amp不收敛是由于conv在amp下会产生上溢,由于模型中的DBFPN结构中 https://github.com/PaddlePaddle/PaddleOCR/blob/main/ppocr/modeling/necks/db_fpn.py#L123-L181 conv2d层输出缺少BN层进行归一化,导致模型不收敛。
解决方案:可以将conv2d结构替换为 ConvBNLayer https://github.com/PaddlePaddle/PaddleOCR/blob/main/ppocr/modeling/backbones/det_mobilenet_v3.py#L158-L200。经验证,模型可以收敛,精度为 best metric, hmean: 0.7441052370315215

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tink2123
Comment options

Answer selected by UserWangZz
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #10874 on May 25, 2024 13:52.