PaddleOCR
PaddleOCR copied to clipboard
自己制作的训练模型字典,自己训练的模型,在使用PPOCRLabel 预标注工具 依然报这个错误
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
- 系统环境/System Environment:MacBook Pro 12.1
- 版本号/Version:Paddle:2.4 PaddleOCR: 问题相关组件/Related components:
- 运行指令/Command Code:python PPOCRLabel.py
- 完整报错/Complete Error Message: [2022/11/04 11:29:17] root WARNING: version PP-OCRv2 not support cls models, auto switch to version PP-OCR Namespace(benchmark=False, cls=True, cls_batch_num=6, cls_image_shape='3, 48, 640', cls_model_dir='/Users/admin/.paddleocr/2.4/ocr/cls/ch_ppocr_mobile_v2.0_cls_infer', cls_thresh=0.9, cpu_threads=10, crop_res_save_dir='/Users/admin/Desktop/四点回归/mx_data/Mx_10_13_save_5/', det=True, det_algorithm='DB', det_db_box_thresh=0.3, det_db_score_mode='fast', det_db_thresh=0.3, det_db_unclip_ratio=2.8, det_east_cover_thresh=0.1, det_east_nms_thresh=0.2, det_east_score_thresh=0.8, det_limit_side_len=960, det_limit_type='max', det_model_dir='/Users/admin/Desktop/PaddleOCR-2.4/Vdong_model/model3/', det_pse_box_thresh=0.85, det_pse_box_type='box', det_pse_min_area=16, det_pse_scale=1, det_pse_thresh=0, det_sast_nms_thresh=0.2, det_sast_polygon=False, det_sast_score_thresh=0.5, draw_img_save_dir='/Users/admin/Desktop/Vietnamese-Documents-OCR/test_img_4_cor/', drop_score=0.5, e2e_algorithm='PGNet', e2e_char_dict_path='/Users/admin/Desktop/PaddleOCR-2.4/ppocr/utils/ppocr_keys_v2.txt', e2e_limit_side_len=768, e2e_limit_type='max', e2e_model_dir=None, e2e_pgnet_mode='fast', e2e_pgnet_score_thresh=0.5, e2e_pgnet_valid_set='totaltext', enable_mkldnn=False, gpu_mem=500, help='==SUPPRESS==', image_dir='/Users/admin/Desktop/Vietnamese-Documents-OCR/test_img_4_1/', ir_optim=True, is_visualize=True, label_list=['0', '180'], label_map_path='./vqa/labels/labels_ser.txt', lang='ch', layout_path_model='lp://PubLayNet/ppyolov2_r50vd_dcn_365e_publaynet/config', max_batch_size=10, max_seq_length=512, max_text_length=25, min_subgraph_size=15, mode='structure', model_name_or_path=None, ocr_version='PP-OCRv2', output='./output', precision='fp32', process_id=0, rec=True, rec_algorithm='CRNN', rec_batch_num=6, rec_char_dict_path='/Users/admin/Desktop/PaddleOCR-2.4/ppocr/utils/ppocr_keys_v_1.txt', rec_image_shape='3, 48, 640', rec_model_dir='/Users/admin/Desktop/PaddleOCR-2.4/Vdong_model/rec_inference_model/', save_crop_res=False, save_log_path='./log_output/', show_log=True, structure_version='STRUCTURE', table_char_dict_path=None, table_char_type='en', table_max_len=488, table_model_dir=None, total_process_num=1, type='ocr', use_angle_cls=True, use_dilation=False, use_gpu=False, use_mp=False, use_onnx=False, use_pdserving=False, use_space_char=True, use_tensorrt=False, use_xpu=False, vis_font_path='/Users/admin/Desktop/PaddleOCR-2.4/doc/fonts/times.ttf', warmup=False) file name in openNext is /Users/admin/Desktop/Vietnamese-Documents-OCR/test_img_4/5072147_Front_of_Official_Credential.jpg DirPath in importDirImages is /Users/admin/Desktop/Vietnamese-Documents-OCR/test_img_4 initPos PyQt5.QtCore.QPointF(185.3655462184874, 49.613445378151255) Traceback (most recent call last): File "/Users/admin/Desktop/PaddleOCR-2.4/PPOCRLabel/PPOCRLabel.py", line 1884, in reRecognition result = self.ocr.ocr(img_crop, cls=True, det=False) File "/Users/admin/Desktop/PaddleOCR-2.4/paddleocr.py", line 396, in ocr rec_res, elapse = self.text_recognizer(img) File "/Users/admin/Desktop/PaddleOCR-2.4/tools/infer/predict_rec.py", line 372, in call rec_result = self.postprocess_op(preds) File "/Users/admin/Desktop/PaddleOCR-2.4/ppocr/postprocess/rec_postprocess.py", line 97, in call text = self.decode(preds_idx, preds_prob, is_remove_duplicate=True) File "/Users/admin/Desktop/PaddleOCR-2.4/ppocr/postprocess/rec_postprocess.py", line 69, in decode idx])]) IndexError: list index out of range
先验证下模型推理是否能跑通,另外可以在报错位置,/Users/admin/Desktop/PaddleOCR-2.4/ppocr/postprocess/rec_postprocess.py 打印输出结果,debug 看数据结构。