PaddleOCR icon indicating copy to clipboard operation
PaddleOCR copied to clipboard

表格识别,使用TableMaster推理时报错

Open PlayerJian opened this issue 7 months ago • 0 comments

问题描述 / Problem Description

运行环境 / Runtime Environment

  • OS: win
  • Paddle: 2.6.1 gpu
  • PaddleOCR: 2.7 2.8 都报错

复现代码 / Reproduction Code

python table/predict_table.py --table_algorithm=TableMaster --table_max_len=480 --det_model_dir=../inference/ch_PP-OCRv3_det_infer --rec_model_dir=../inference/ch_PP-OCRv3_rec_infer --table_model_dir=../inference/table_structure_tablemaster_infer --rec_char_dict_path=../ppocr/utils/ppocr_keys_v1.txt --table_char_dict_path=../ppocr/utils/dict/table_structure_dict_ch.txt --image_dir=E:\workspace\traindata\OCRliushui\result_img\01_pete1f1a_page1.png --output=./output/table

完整报错 / Complete Error Message

python table/predict_table.py --table_algorithm=TableMaster --table_max_len=480 --det_model_dir=../inference/ch_PP-OCRv3_det_infer --rec_model_dir=../inference/ch_PP-OCRv3_rec_infer --table_model_dir=../inference/table_structure_tablemaster_infer --rec_char_dict_path=../ppocr/utils/ppocr_keys_v1.txt --table_char_dict_path=../ppocr/utils/dict/table_structure_dict_ch.txt --image_dir=E:\workspace\traindata\OCRliushui\result_img\01_pete1f1a_page1.png --output=./output/table [2024/07/18 11:34:46] ppocr WARNING: The first GPU is used for inference by default, GPU ID: 0 [2024/07/18 11:34:50] ppocr WARNING: The first GPU is used for inference by default, GPU ID: 0 [2024/07/18 11:34:51] ppocr WARNING: The first GPU is used for inference by default, GPU ID: 0 [2024/07/18 11:34:56] ppocr WARNING: The first GPU is used for inference by default, GPU ID: 0 [2024/07/18 11:34:59] ppocr INFO: [0/1] E:\workspace\traindata\OCRliushui\result_img\01_pete1f1a_page1.png [2024/07/18 11:35:23] ppocr DEBUG: dt_boxes num : 331, elapse : 0.23046422004699707 [2024/07/18 11:35:24] ppocr DEBUG: rec_res num : 331, elapse : 0.6179745197296143 Traceback (most recent call last): File "E:\workspace\project\pro_paddle\PaddleOCR28\ppstructure\table\predict_table.py", line 241, in main(args) File "E:\workspace\project\pro_paddle\PaddleOCR28\ppstructure\table\predict_table.py", line 189, in main pred_res, _ = table_sys(img) File "E:\workspace\project\pro_paddle\PaddleOCR28\ppstructure\table\predict_table.py", line 109, in call pred_html = self.match(structure_res, dt_boxes, rec_res) File "E:\workspace\project\pro_paddle\PaddleOCR28\ppstructure\table\table_master_match.py", line 991, in call match_results = self.match() File "E:\workspace\project\pro_paddle\PaddleOCR28\ppstructure\table\table_master_match.py", line 795, in match ) = get_bboxes_list(end2end_result, structure_master_result) File "E:\workspace\project\pro_paddle\PaddleOCR28\ppstructure\table\table_master_match.py", line 310, in get_bboxes_list xywh_bbox = xyxy2xywh(src_bboxes) File "E:\workspace\project\pro_paddle\PaddleOCR28\ppstructure\table\table_master_match.py", line 72, in xyxy2xywh new_bboxes[0] = bboxes[0] + (bboxes[2] - bboxes[0]) / 2 IndexError: index 0 is out of bounds for axis 0 with size 0

可能解决方案 / Possible solutions

附件 / Appendix

PlayerJian avatar Jul 18 '24 03:07 PlayerJian