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

AttributeError: module layoutparser has no attribute PaddleDetectionLayoutModel #107

Closed
chiehpower opened this issue Dec 28, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@chiehpower
Copy link

Describe the bug

Cannot pass the line of lp.PaddleDetectionLayoutModel

Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> import layoutparser as lp
>>>  model = lp.PaddleDetectionLayoutModel(config_path="lp://PubLayNet/ppyolov2_r50vd_dcn_365e_publaynet/config",
...                                 threshold=0.5,
...                                 label_map={0: "Text", 1: "Title", 2: "List", 3:"Table", 4:"Figure"},
...                                 enforce_cpu=False,
...                                 enable_mkldnn=True)
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/local/lib/python3.6/dist-packages/layoutparser/file_utils.py", line 226, in __getattr__
    raise AttributeError(f"module {self.__name__} has no attribute {name}")
AttributeError: module layoutparser has no attribute PaddleDetectionLayoutModel

To Reproduce
Steps to reproduce the behavior:

Follow the step from official sample
https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.3/ppstructure/layout/README.md#2-quick-start

Environment

  1. Please describe your Platform [Windows/MacOS/Linux] Linux. AGX jetson device, JetPack4.6
  2. Please show the Layout Parser version : layoutparser 0.3.2
  3. You may add addition that may be helpful for locating the problem, such as
    • How you installed PyTorch [e.g., pip, conda, source] pip to install torch. Haven tried by Python3.8 and Python3.6
    • Other environment variables that may be related (such as $PATH, $LD_LIBRARY_PATH, $PYTHONPATH, etc.)
@chiehpower chiehpower added the bug Something isn't working label Dec 28, 2021
@chiehpower
Copy link
Author

Fixed it by installing the layoutparser package below:

wget https://paddleocr.bj.bcebos.com/whl/layoutparser-0.0.0-py3-none-any.whl
pip install -U layoutparser-0.0.0-py3-none-any.whl

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

1 participant