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

NameError: name 'predict_system' is not defined #12057

Closed
forrestr91 opened this issue May 6, 2024 · 7 comments
Closed

NameError: name 'predict_system' is not defined #12057

forrestr91 opened this issue May 6, 2024 · 7 comments
Assignees

Comments

@forrestr91
Copy link

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem

  • 系统环境/System Environment:Ubuntu 20.04.6 LTS
  • 版本号/Version:Paddle: 2.6.1 PaddleOCR:2.7.5 问题相关组件/Related components:
  • 运行指令/Command Code:
  • import os
    import cv2
    from paddleocr import PPStructure,save_structure_res

table_engine = PPStructure(table=False, ocr=False, show_log=True)

save_folder = './output'
img_path = '1.png'
img = cv2.imread(img_path)
result = table_engine(img)
save_structure_res(result, save_folder, os.path.basename(img_path).split('.')[0])

for line in result:
line.pop('img')
print(line)

  • 完整报错/Complete Error Message:
    13 # limitations under the License.
    ---> 14 from .paddleocr import *
    16 version = paddleocr.VERSION
    17 all = [
    18 'PaddleOCR', 'PPStructure', 'draw_ocr', 'draw_structure_result',
    19 'save_structure_res', 'download_with_progressbar', 'sorted_layout_boxes',
    20 'convert_info_docx', 'to_excel'
    21 ]

File ~/.local/lib/python3.10/site-packages/paddleocr/paddleocr.py:575
...
579 args:
580 **kwargs: other params show in paddleocr --help
581 """

NameError: name 'predict_system' is not defined

@UserWangZz
Copy link
Collaborator

你好,可以提供一下完整的报错信息吗?这个目前看不太出来问题出在什么地方

@forrestr91
Copy link
Author

你好,可以提供一下完整的报错信息吗?这个目前看不太出来问题出在什么地方

image

@UserWangZz
Copy link
Collaborator

predict_system在tools/infer/下,可以尝试手动导入一下看看

@forrestr91
Copy link
Author

predict_system在tools/infer/下,可以尝试手动导入一下看看

换成2.7.0.0版本,可以了。

@UserWangZz
Copy link
Collaborator

我们记录一下,排查一下问题

@zwfcrazy
Copy link

zwfcrazy commented May 8, 2024

我们记录一下,排查一下问题

从2.7.1开始paddleocr.py里面就缺了这句话from tools.infer import predict_system

@UserWangZz
Copy link
Collaborator

好的,感谢发现问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants