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 #1858

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

trOCR in onnx format does not read full text #1858

feff2 opened this issue May 16, 2024 · 2 comments

Comments

@feff2
Copy link

feff2 commented May 16, 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?

@amyeroberts
@pacman100

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

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)

@amyeroberts
Copy link

Hi @feff2, thanks for raising an issue!

I'm transferring this issue to the optimum repo, as it seems this is more related to that library.

@amyeroberts amyeroberts transferred this issue from huggingface/transformers May 16, 2024
@feff2
Copy link
Author

feff2 commented May 16, 2024

@amyeroberts , thanks!

@feff2 feff2 closed this as completed May 16, 2024
@feff2 feff2 reopened this May 17, 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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants