Skip to content

Conversation

@liuhongen1234567
Copy link
Collaborator

  1. paddle.multinomial 在onnxruntime 中存在bug,使用paddle.argmax替换,经验证精度符合预期
  2. albumentations默认装albucore=0.24 会报错,将其降级
@paddle-bot
Copy link

paddle-bot bot commented Mar 20, 2025

Thanks for your contribution!

@GreatV
Copy link
Collaborator

GreatV commented Mar 20, 2025

image
这会导致numpy不能安装大于2.0的版本

@liuhongen1234567
Copy link
Collaborator Author

liuhongen1234567 commented Mar 20, 2025

image 这会导致numpy不能安装大于2.0的版本

这个有冲突好像是albumentation的冲突不是albucore==0.0.16的冲突,想确认下numpy大于2的必要性?另外,您那边安装paddleocr的时候后,使用不会报mportError: cannot import name 'preserve_channel_dim' from 'albucore.utils' (/root/anaconda3/envs/paddle_latest/lib/python3.10/site-packages/albucore/utils.py) 这个错误吗?
image

@GreatV
Copy link
Collaborator

GreatV commented Mar 20, 2025

numpy 大于2.0不是必须的,但是最好也不应固定版本。我只安装paddleocr的话不会报错。

@liuhongen1234567
Copy link
Collaborator Author

liuhongen1234567 commented Mar 20, 2025

numpy 大于2.0不是必须的,但是最好也不应固定版本。我只安装paddleocr的话不会报错。

我这边单独安装也不会报错,不过使用公式推理时报错,要不我把albucore==0.0.16移到公式识别那个requirement里吧。这个主要是albumentation要与albucore版本采用默认方式匹配不上,如果指定albumentation==2.0以上可以支持numpy>2,但是也是把numpy限制死了

@GreatV
Copy link
Collaborator

GreatV commented Mar 20, 2025

@liuhongen1234567
Copy link
Collaborator Author

这确实是一个比较常见的问题,最新版本还是会报这个错误吗,如果还是这样,那就先这样直接限制版本吧。

@GreatV GreatV requested a review from Copilot April 13, 2025 03:35
Copy link

Copilot AI left a 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])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants