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

paddle_inference.dllv2.5版本的mkldnn.dll开启加速,OCR准确率大幅下降,惨不忍睹 #55281

Closed
raoyutian opened this issue Jul 10, 2023 · 3 comments
Labels

Comments

@raoyutian
Copy link

bug描述 Describe the Bug

v2.5版本C++版本paddle_inference.dll,在使用PaddleOCR时,经过测试,使用EnableMKLDNN()方法时,OCR识别精度,无论是V3,V4模型,均大幅度降低。不开启MKLDNN,则可以正常识别。
同样的OCR代码,引用v2.5rc1和v2.4.2版本C++版本paddle_inference.dll,均可正常识别。

实际与2.5版本的mkldnn.dll文件有关。

希望能尽快修复该问题。

其他补充信息 Additional Supplementary Information

No response

@Birdylx
Copy link

Birdylx commented Jul 10, 2023

@raoyutian
该问题会提交给相关同学,感谢反馈,如有需求可以先自行编译一个paddle inference预测库。

@raoyutian
Copy link
Author

解决方案:
第一种,
paddle_inference代码中的paddle\fluid\inference\api\paddle_pass_builder.cc文件void CpuPassStrategy::EnableMKLDNN()
代码中,注释两个pass,fc_mkldnn_pass,fc_act_mkldnn_fuse_pass,这两个在之前版本就是注释的,2.5被取消注释。影响OCR识别精度降低,
第二种,
PaddleOCR代码删除这两个pass
pass_builder->DeletePass("fc_mkldnn_pass");
pass_builder->DeletePass("fc_act_mkldnn_fuse_pass");
推荐第二种,第一种更改了不知道会不会影响模块。

@raoyutian
Copy link
Author

该问题已经在2.5.1版本的预测库中修复。实测有效 。
#55504

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants