Skip to content

[Inference]Fix batch_norm converter bugs and rename unittest #68170

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

Merged

Conversation

YuanRisheng
Copy link
Contributor

@YuanRisheng YuanRisheng commented Sep 12, 2024

PR Category

Inference

PR Types

Bug fixes

Description

card-71500
本PR工作如下:
1,修复batch_norm converter计算异常的bug
2,单测命名规范化,支持传入自定义精度误差

Copy link

paddle-bot bot commented Sep 12, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

XieYunshen
XieYunshen previously approved these changes Sep 12, 2024
actual_scale_np = scale_np / np.sqrt(variance_np + eps)
actual_bias_np = bias_np - mean_np * actual_scale_np
bias = trt.Weights(actual_bias_np)
scale = trt.Weights(actual_scale_np)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

单测没发现bug吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

单测没有发现,因为使用了batch norm其中的一些默认值恰好计算出来是没有问题的结果

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

再把test_converter_model_resnet50.py跑一遍,看看那个精度是多少吧,之前设置的是2e-1

@YuanRisheng YuanRisheng merged commit 8d9b996 into PaddlePaddle:develop Sep 13, 2024
28 of 30 checks passed
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.

4 participants