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

中文pdf转word报错 #13429

Closed
navidog8888 opened this issue Jul 18, 2024 · 2 comments
Closed

中文pdf转word报错 #13429

navidog8888 opened this issue Jul 18, 2024 · 2 comments

Comments

@navidog8888
Copy link

问题描述 / Problem Description

中文pdf转word报错。

运行环境 / Runtime Environment

  • OS: Linux jupyter-2046977-8171292 5.4.0-139-generic 有计划对繁体字做支持吗 #156-Ubuntu SMP Fri Jan 20 17:27:18 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • Paddle: paddlepaddle-gpu 2.4.0.post112
  • PaddleOCR: 2.7.0.2
  • python:3.7.4

复现代码 / Reproduction Code

!python3 /home/aistudio/PaddleOCR/ppstructure/predict_system.py
--image_dir=/home/aistudio/1721202911238.png
--det_model_dir=/home/aistudio/PaddleOCR/ppstructure/inference/ch_PP-OCRv4_det_infer
--rec_model_dir=/home/aistudio/PaddleOCR/ppstructure/inference/ch_PP-OCRv4_rec_infer
--rec_char_dict_path=/home/aistudio/PaddleOCR/ppocr/utils/ppocr_keys_v1.txt
--table_model_dir=/home/aistudio/PaddleOCR/ppstructure/inference/ch_ppstructure_mobile_v2.0_SLANet_infer
--table_char_dict_path=/home/aistudio/PaddleOCR/ppocr/utils/dict/table_structure_dict.txt
--layout_model_dir=/home/aistudio/PaddleOCR/ppstructure/inference/picodet_lcnet_x1_0_fgd_layout_cdla_infer
--layout_dict_path=/home/aistudio/PaddleOCR/ppocr/utils/dict/layout_dict/layout_cdla_dict.txt
--vis_font_path=/home/aistudio/PaddleOCR/doc/fonts/chinese_cht.ttf
--recovery=True
--output=/home/aistudio/PaddleOCR/output/

完整报错 / Complete Error Message

Traceback (most recent call last):
File "/home/aistudio/PaddleOCR/ppstructure/predict_system.py", line 394, in
main(args)
File "/home/aistudio/PaddleOCR/ppstructure/predict_system.py", line 329, in main
res, time_dict = structure_sys(img, img_idx=index)
File "/home/aistudio/PaddleOCR/ppstructure/predict_system.py", line 154, in call
roi_img, return_ocr_result_in_table
File "/home/aistudio/PaddleOCR/ppstructure/table/predict_table.py", line 96, in call
structure_res, elapse = self._structure(copy.deepcopy(img))
File "/home/aistudio/PaddleOCR/ppstructure/table/predict_table.py", line 118, in _structure
structure_res, elapse = self.table_structurer(copy.deepcopy(img))
File "/home/aistudio/PaddleOCR/ppstructure/table/predict_structure.py", line 153, in call
post_result = self.postprocess_op(preds, [shape_list])
File "/home/aistudio/PaddleOCR/ppocr/postprocess/table_postprocess.py", line 53, in call
result = self.decode(structure_probs, bbox_preds, shape_list)
File "/home/aistudio/PaddleOCR/ppocr/postprocess/table_postprocess.py", line 81, in decode
text = self.character[char_idx]
IndexError: list index out of range

可能解决方案 / Possible solutions

附件 / Appendix

@GreatV
Copy link
Collaborator

GreatV commented Jul 18, 2024

更新一下paddle版本和paddleocr版本再试试

@navidog8888
Copy link
Author

更新一下paddle版本和paddleocr版本再试试

谢谢。建议用哪个版本的paddle和paddleocr呢

@GreatV GreatV closed this as completed Aug 12, 2024
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

2 participants