Layout-Parser / layout-parser

A Unified Toolkit for Deep Learning Based Document Image Analysis
https://layout-parser.github.io/
Apache License 2.0
4.75k stars 456 forks source link

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

Open frederick0291 opened 2 years ago

frederick0291 commented 2 years ago

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.

lolipopshock commented 2 years ago

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