AttributeError: module layoutparser has no attribute Detectron2LayoutModel on conversion to exe
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
- I have searched related issues but cannot get the expected help.
- The bug has not been fixed in the latest version, see the Layout Parser Releases
To Reproduce Steps to reproduce the behavior:
- Create venv.
- Install layoutparser with detectron2.
- Install auto-py-to-exe.
- Convert python file to exe file.
- Run the exe file.
Environment
- Windows
- Layoutparser ver 0.3.2
- 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.
Thanks for brining this up -- I am not familiar with bundling python scripts to exe programs, but will take a closer look later!