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

release/3.0-rc版本更新后,表格识别产线使用异常 #3522

Open
4 tasks
tlishi opened this issue Mar 4, 2025 · 5 comments
Open
4 tasks

release/3.0-rc版本更新后,表格识别产线使用异常 #3522

tlishi opened this issue Mar 4, 2025 · 5 comments
Assignees

Comments

@tlishi
Copy link

tlishi commented Mar 4, 2025

Checklist:

描述问题

复现

  1. 您是否已经正常运行我们提供的教程
    运行表格识别产线的python脚本代码,或者命令行指令报错
  2. 您是否在教程的基础上修改代码内容?还请您提供运行的代码
    修改了图片路径,运行这个脚本出错
from paddlex import create_pipeline

pipeline = create_pipeline(pipeline="table_recognition_v2")

output = pipeline.predict(
    input="table_recognition.jpg",
    use_doc_orientation_classify=False,
    use_doc_unwarping=False,
)

for res in output:
    res.print()
    res.save_to_img("./output/")
    #res.save_to_xlsx("./output/")
    #res.save_to_html("./output/")
    res.save_to_json("./output/")

教程的指令paddlex --pipeline table_recognition --input table_recognition.jpg --save_path ./output --device gpu:0运行也出错

这个产线在更新前我成功运行过,更新后报错
3. 您使用的数据集是?
单张图片
4. 请提供您出现的报错信息及相关log

Using official model (PP-LCNet_x1_0_doc_ori), the model files will be automatically downloaded and saved in C:\Users\tls\.paddlex\official_models.
信息: 用提供的模式无法找到文件。
D:\a\pythonTool\Anaconda3\envs\paddleocr\lib\site-packages\paddle\utils\cpp_extension\extension_utils.py:711: UserWarning: No ccache found. Please be aware that recompiling all source files may be required. You can download and install ccache from: https://github.com/ccache/ccache/blob/master/doc/INSTALL.md
  warnings.warn(warning_message)
E0304 16:59:53.734315 12728 analysis_config.cc:169] Please use PaddlePaddle with GPU version.
Using official model (UVDoc), the model files will be automatically downloaded and saved in C:\Users\tls\.paddlex\official_models.
E0304 16:59:54.168550 12728 analysis_config.cc:169] Please use PaddlePaddle with GPU version.
Using official model (PicoDet_layout_1x_table), the model files will be automatically downloaded and saved in C:\Users\tls\.paddlex\official_models.
Traceback (most recent call last):
  File "\\?\D:\a\pythonTool\Anaconda3\envs\paddleocr\Scripts\paddlex-script.py", line 33, in <module>
    sys.exit(load_entry_point('paddlex', 'console_scripts', 'paddlex')())
  File "d:\a\mnist\paddleocr\paddlex\paddlex\__main__.py", line 26, in console_entry
    main()
  File "d:\a\mnist\paddleocr\paddlex\paddlex\paddlex_cli.py", line 457, in main
    return pipeline_predict(
  File "d:\a\mnist\paddleocr\paddlex\paddlex\paddlex_cli.py", line 312, in pipeline_predict
    pipeline = create_pipeline(pipeline, device=device, use_hpip=use_hpip)
  File "d:\a\mnist\paddleocr\paddlex\paddlex\inference\pipelines\__init__.py", line 155, in create_pipeline
    pipeline = BasePipeline.get(pipeline_name)(
  File "d:\a\mnist\paddleocr\paddlex\paddlex\inference\pipelines\table_recognition\pipeline.py", line 75, in __init__
    self.layout_det_model = self.create_model(layout_det_config)
  File "d:\a\mnist\paddleocr\paddlex\paddlex\inference\pipelines\base.py", line 86, in create_model
    model = create_predictor(
  File "d:\a\mnist\paddleocr\paddlex\paddlex\inference\models\__init__.py", line 97, in create_predictor
    assert (
AssertionError: Model name mismatch,please input the correct model dir.

环境

  1. 请提供您使用的PaddlePaddle和PaddleX的版本号
    release/3.0-rc
  2. 请提供您使用的操作系统信息,如Linux/Windows/MacOS
    Windows
  3. 请问您使用的Python版本是?
    3.9
  4. 请问您使用的CUDA/cuDNN的版本号是?
    无gpu
@liu-jiaxuan
Copy link
Collaborator

你好,基于报错信息,请检查以下两点是否正确~

  1. 默认模型权重是否被正确下载并加载,可以通过尝试其他产线进行确认
  2. 是否在无gpu的情况下,选择了加载gpu进行处理

@tlishi
Copy link
Author

tlishi commented Mar 6, 2025

您好,尝试OCR产线正常,请问如何检查正确下载并加载了默认模型权重?我尝试了wheel包和插件模式,新建conda环境安装paddlepaddle,都出现了这样的错误信息。

@2547881370
Copy link

2547881370 commented Mar 7, 2025

model = create_model(model_path)

在使用gpu版本的时候正常
paddlepaddle-gpu : Version: 3.0.0b2
paddlex : Version: 3.0.0b2

切换到cpu版本的时候异常
paddlepaddle : Version: 3.0.0rc0
paddlex : Version: 3.0.0rc0

AssertionError: Model name mismatch,please input the correct model dir.

操作系统 : Windows
Python 3.8.20

@tlishi
Copy link
Author

tlishi commented Mar 7, 2025

对的,我这使用cpu就无法使用表格产线。请团队尽快修复。我试了上个版本beta2没有问题,可以正常识别

@TingquanGao
Copy link
Collaborator

PaddleX的create_model()在3.0rc有变化:需要指定model_name,且如果使用本地模型,需要通过model_dir指定模型路径。

具体可以查看文档:
https://github.com/PaddlePaddle/PaddleX/blob/release/3.0-rc/docs/API_change_log/v3.0.0rc.md#1-create_model

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

No branches or pull requests

5 participants