-
Notifications
You must be signed in to change notification settings - Fork 8.2k
fix onnx in latexocr #14909
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
base: main
Are you sure you want to change the base?
fix onnx in latexocr #14909
Conversation
liuhongen1234567
commented
Mar 20, 2025
- paddle.multinomial 在onnxruntime 中存在bug,使用paddle.argmax替换,经验证精度符合预期
- albumentations默认装albucore=0.24 会报错,将其降级
Thanks for your contribution! |
numpy 大于2.0不是必须的,但是最好也不应固定版本。我只安装paddleocr的话不会报错。 |
我这边单独安装也不会报错,不过使用公式推理时报错,要不我把albucore==0.0.16移到公式识别那个requirement里吧。这个主要是albumentation要与albucore版本采用默认方式匹配不上,如果指定albumentation==2.0以上可以支持numpy>2,但是也是把numpy限制死了 |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
ppocr/modeling/heads/rec_latexocr_head.py:910
- [nitpick] Replacing paddle.multinomial with paddle.argmax makes the inference deterministic. Verify that the removal of the probabilistic sampling mechanism is intended and acceptable for the model's performance.
sample = paddle.argmax(logits, axis=1).reshape([-1, 1])
ppocr/modeling/heads/rec_latexocr_head.py:962
- [nitpick] The use of paddle.argmax in the generate_export function enforces deterministic outputs. Confirm that this change aligns with your intended export behavior and does not adversely affect model evaluation.
sample = paddle.argmax(logits, axis=1).reshape([-1, 1])