PaddlePaddle / PaddleX

All-in-One Development Tool based on PaddlePaddle(飞桨低代码开发工具)
Apache License 2.0
4.83k stars 951 forks source link

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

Open vision1v1 opened 1 week ago

vision1v1 commented 1 week ago

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

Sunting78 commented 1 week ago

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

vision1v1 commented 6 days ago

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。或者报错不友好。

Sunting78 commented 1 day ago

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

changdazhou commented 1 day ago

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