Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Usage lp.models. Detectron2LayoutModel #179

Open
mertakcay opened this issue Apr 3, 2023 · 1 comment
Open

Cannot Usage lp.models. Detectron2LayoutModel #179

mertakcay opened this issue Apr 3, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@mertakcay
Copy link

Describe the bug
I cannot use Decetron2LayoutModel despite successfully install.

Usage of LP

lp.models.Detectron2LayoutModel(...)
lp.Detectron2LayoutModel(...)

Environment

  1. On MacOS having M1 chip
  2. '0.3.4' Version
  3. With Pip Env on VSCode JupyterNotebook

Error traceback
AttributeError: partially initialized module 'layoutparser' has no attribute 'Detectron2LayoutModel' (most likely due to a circular import)

@mertakcay mertakcay added the bug Something isn't working label Apr 3, 2023
@jjbiggins
Copy link

This most likely not a bug. The error says it's most likely due to a circular import. This happens when the filename of the python program has the same name as another module it imports. So, in this case, I'm guessing the filename of your python program is layoutparser.py and it's calling import layoutparser as lp in it. Change the filename to something else, and it should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants