conjuncts / gmft

Lightweight, performant, deep table extraction
MIT License
31 stars 2 forks source link

Cannot close object, library is destroyed. #5

Closed tcoca27 closed 4 days ago

tcoca27 commented 5 days ago

Stumbled upon this project from a reddit thread.

Tried to run the basic example from the quickstart notebook. Installed the library, but when running the example the following error occurs: -> Cannot close object, library is destroyed. This may cause a memory leak! -> Cannot close object, library is destroyed. This may cause a memory leak! -> Cannot close object, library is destroyed. This may cause a memory leak!

Also found this maybe related issue in the nougat repo: https://github.com/facebookresearch/nougat/issues/222 . Downgrading transformers still provides the same output.

Library versions: transformers-4.42.3 pypdfium2-4.30.0

conjuncts commented 5 days ago

Sounds like an issue with pypdfium2 with closing documents. For example, if you use a table whose document has been closed, this warning might pop up. In which cell does this issue occur? Also, do no results work at all, or is it a warning?

The fix might be to call PyPDFium2Utils.reload(ct) to use a CroppedTable whose document has been closed.

tcoca27 commented 4 days ago

Indeed it was a warning, and indeed it came from a close call as you mentioned.

Great work on the lib! It looks promising