layout-parser icon indicating copy to clipboard operation
layout-parser copied to clipboard

AttributeError: module layoutparser has no attribute Detectron2LayoutModel on conversion to exe

Open frederick0291 opened this issue 2 years ago • 1 comments

Describe the bug Exe file keeps throwing an error AttributeError: module layoutparser has no attribute Detectron2LayoutModel. Python file works fine on virtualenv when trying to run.

Checklist

  1. I have searched related issues but cannot get the expected help.
  2. The bug has not been fixed in the latest version, see the Layout Parser Releases

To Reproduce Steps to reproduce the behavior:

  1. Create venv.
  2. Install layoutparser with detectron2.
  3. Install auto-py-to-exe.
  4. Convert python file to exe file.
  5. Run the exe file.

Environment

  1. Windows
  2. Layoutparser ver 0.3.2
  3. You may add addition that may be helpful for locating the problem, such as
    • Torch and torchvision installed.

Error traceback File "main.py", line 238, in aaoStartProcess File "ExtractPDFText.py", line 145, in imageToCV File "ExtractPDFText.py", line 45, in parse_table_figure_layout File "layoutparser\file_utils.py", line 226, in getattr

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

frederick0291 avatar Oct 20 '21 13:10 frederick0291

Thanks for brining this up -- I am not familiar with bundling python scripts to exe programs, but will take a closer look later!

lolipopshock avatar Oct 21 '21 18:10 lolipopshock