添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
冷静的口罩  ·  Cintia D'Urso: ...·  3 月前    · 
温文尔雅的大白菜  ·  样式 | Avalonia Docs·  9 月前    · 
不要命的自行车  ·  Time lag and ...·  10 月前    · 

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

问题描述 / Problem Description

When I try to import paddleocr, it return ModuleNotFoundError: No module named 'tools.infer' , this happened on my environment with Detectron2 are installed.

运行环境 / Runtime Environment

  • OS: Docker - Ubuntu 22.04.2 LTS
  • Paddlepaddle-gpu: 2.6.1
  • PaddleOCR: 2.8.0
  • Detectron2 version : 0.6+864913fpt2.1.2cu121
  • CUDA Version : 12.1
  • 复现代码 / Reproduction Code

    from paddleocr import PaddleOCR
    

    完整报错 / Complete Error Message

    Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from paddleocr import PaddleOCR
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/lib/python3.10/dist-packages/paddleocr/__init__.py", line 14, in <module>
        from .paddleocr import *
      File "/usr/local/lib/python3.10/dist-packages/paddleocr/paddleocr.py", line 34, in <module>
        from tools.infer import predict_system
    ModuleNotFoundError: No module named 'tools.infer'
    

    可能解决方案 / Possible solutions

    I manually edit the paddle.py file, on code
    from :

    from tools.infer import predict_system
    from tools.infer.utility import draw_ocr, str2bool, check_gpu
    
    from paddleocr.tools.infer import predict_system
    from paddleocr.tools.infer.utility import draw_ocr, str2bool, check_gpu
    

    附件 / Appendix