deepdoctection icon indicating copy to clipboard operation
deepdoctection copied to clipboard

Error in input/output sizing when running "analyzer_with_table_transformer_notebook"

Open greydanus opened this issue 1 year ago • 3 comments

I'm getting an error associated with the output sizing of a layer being too small:

Screen Shot 2024-06-14 at 1 06 01 PM

It's possible that this is due to an error associated with loading saved weights:

Screen Shot 2024-06-14 at 1 09 42 PM

However, after reading issue https://github.com/deepdoctection/deepdoctection/issues/290, which talks about how these warnings don't need to be taken too seriously, I am uncertain that this is the root cause.

I encountered this error in the process of trying to reproduce the results in the analyzer_with_table_transformer tutorial.

You can reproduce this error by running this Colaboratory notebook: https://colab.research.google.com/drive/1wrZLIOlvU7sAu0gVc3s4uCTCmKcA64df?usp=sharing

greydanus avatar Jun 14 '24 20:06 greydanus

Note, this occurs even without table transformers or table detection, eg:

analyzer = dd.get_dd_analyzer(reset_config_file=True,
                              config_overwrite=
   [
    "OCR.USE_DOCTR=True",  # we disable Tesseract and use DocTr as OCR engine
    "OCR.USE_TESSERACT=False"])

Switching to ["OCR.USE_DOCTR=False", "OCR.USE_TESSERACT=True"] fixes things. So I think that whatever is going wrong is related to how docTR is being used.

greydanus avatar Jun 14 '24 23:06 greydanus

Thanks for reporting and providing the Colab with the sample.

I was eventually able to reproduce this issue locally and the root of this is the pre-processor of the DocTr-text recognizer which is instantiated with a bad configuration. This results in unexpected tensor sizes.

I have provided a fix along with #344. It is only available on the main branch for now.

Feel free to check if it is working for you.

JaMe76 avatar Jun 16 '24 11:06 JaMe76

I just pip installed directly from main and was able to run this successfully. Thanks for the quick fix!

greydanus avatar Jun 17 '24 18:06 greydanus

Closing with Closing with #344 .

JaMe76 avatar Nov 08 '24 09:11 JaMe76