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

trOCR in onnx format does not read full text #1857

Closed
2 of 4 tasks
feff2 opened this issue May 15, 2024 · 0 comments
Closed
2 of 4 tasks

trOCR in onnx format does not read full text #1857

feff2 opened this issue May 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@feff2
Copy link

feff2 commented May 15, 2024

System Info

platform: Windows 10
optimum version 1.19.2
transformers version 4.40.2
onnx version 1.16.0
onnxruntime version 1.17.3

Who can help?

@michaelbenayoun
@JingyaHuang
@echarlaix

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction (minimal, reproducible, runnable)

I have trained the small-printed trocr on my custom dataset having multiline images. The trained model can read full text. But while converting the model to onnx, the model detects only first line or part of it in first line. I have used this [https://github.com/huggingface/transformers/issues/19811#issuecomment-1303072202](https://gist.github.com/mht-sharma/f38c670930ac7df413c07327e692ee39)
for inference and this command "optimum-cli export onnx -m {model_checkpoints} --task vision2seq-lm onnx/ --atol 1e-3" for convert to onnx

Expected behavior

It is unclear why the model recognizes only the first line of text (with almost no loss of quality)

@feff2 feff2 added the bug Something isn't working label May 15, 2024
@feff2 feff2 closed this as completed Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant