PaddleX icon indicating copy to clipboard operation
PaddleX copied to clipboard

产品线 table_recognition, 官方示例中 代码中错误。 ocr_res 变量没有初始化。

Open vision1v1 opened this issue 1 year ago • 2 comments

Checklist:

  1. 查找历史相关issue寻求解答
  2. 翻阅FAQ常见问题汇总和答疑
  3. 确认bug是否在新版本里还未修复
  4. 翻阅PaddleX 使用文档

描述问题

复现

  1. 您是否已经正常运行我们提供的教程

  2. 您是否在教程的基础上修改代码内容?还请您提供运行的代码

  3. 您使用的数据集是?

  4. 请提供您出现的报错信息及相关log

环境

  1. 请提供您使用的PaddlePaddle和PaddleX的版本号

Name: paddlepaddle Version: 3.0.0b1

  1. 请提供您使用的操作系统信息,如Linux/Windows/MacOS

Windows

  1. 请问您使用的Python版本是?

Python 3.8.2

  1. 请问您使用的CUDA/cuDNN的版本号是?

CPU

07

报错信息

Traceback (most recent call last): File "test02.py", line 24, in test02() File "test02.py", line 17, in test02 for res in output: File "D:\common_program\miniconda3\envs\kt\lib\site-packages\paddlex\inference\pipelines\table_recognition\table_recognition.py", line 121, in pred ict single_img_res["ocr_result"] = OCRResult(ocr_res) UnboundLocalError: local variable 'ocr_res' referenced before assignment

vision1v1 avatar Oct 12 '24 03:10 vision1v1

您好,请提供下运行的脚本内容。

Sunting78 avatar Oct 14 '24 11:10 Sunting78

pipeline = create_pipeline(pipeline="table_recognition", device="cpu") output = pipeline.predict("./imgs/07.png") # 图片就是上面那张图 for res in output: res.print() res.save_to_xlsx("./output/table_recognition")

我调试进去,发现如果分类模型判断不是table 而是 figure 就会报错,这应该是逻辑bug。或者报错不友好。

vision1v1 avatar Oct 18 '24 07:10 vision1v1

收到 感谢您报bug 我们排查下

Sunting78 avatar Oct 23 '24 12:10 Sunting78

请问是使用的最新代码吗,建议更新到最新代码测试一下哈,该BUG已修复

changdazhou avatar Oct 23 '24 13:10 changdazhou

The issue has no response for a long time and will be closed. You can reopen or new another issue if are still confused.


From Bot

TingquanGao avatar Nov 24 '24 03:11 TingquanGao