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

Cannot open file PULC\text_image_orientation, please confirm whether the file is normal. #14268

Open
3 tasks done
monkeycc opened this issue Nov 23, 2024 · 1 comment
Open
3 tasks done

Comments

@monkeycc
Copy link

🔎 Search before asking

  • I have searched the PaddleOCR Docs and found no similar bug report.
  • I have searched the PaddleOCR Issues and found no similar bug report.
  • I have searched the PaddleOCR Discussions and found no similar bug report.

🐛 Bug (问题描述)

paddleocr --image_dir=C:\Users\mm\Downloads\OCR\1.png --type=structure --image_orientation=true

[2024/11/23 09:25:44] ppocr INFO: for usage help, please use `paddleocr --help`
[2024/11/23 09:25:44] ppocr DEBUG: Namespace(help='==SUPPRESS==', use_gpu=True, use_xpu=False, use_npu=False, use_mlu=False, ir_optim=True, use_tensorrt=False, min_subgraph_size=15, precision='fp32', gpu_mem=500, gpu_id=0, image_dir='C:/Users/mm/Downloads/OCR/1.png', page_num=0, det_algorithm='DB', det_model_dir='C:\\Users\\mm/.paddleocr/whl\\det\\ch\\ch_PP-OCRv4_det_infer', det_limit_side_len=960, det_limit_type='max', det_box_type='quad', det_db_thresh=0.3, det_db_box_thresh=0.6, det_db_unclip_ratio=1.5, max_batch_size=10, use_dilation=False, det_db_score_mode='fast', det_east_score_thresh=0.8, det_east_cover_thresh=0.1, det_east_nms_thresh=0.2, det_sast_score_thresh=0.5, det_sast_nms_thresh=0.2, det_pse_thresh=0, det_pse_box_thresh=0.85, det_pse_min_area=16, det_pse_scale=1, scales=[8, 16, 32], alpha=1.0, beta=1.0, fourier_degree=5, rec_algorithm='SVTR_LCNet', rec_model_dir='C:\\Users\\mm/.paddleocr/whl\\rec\\ch\\ch_PP-OCRv4_rec_infer', rec_image_inverse=True, rec_image_shape='3, 48, 320', rec_batch_num=6, max_text_length=25, rec_char_dict_path='D:\\anaconda3\\envs\\paddlepaddle\\lib\\site-packages\\paddleocr\\ppocr\\utils\\ppocr_keys_v1.txt', use_space_char=True, vis_font_path='./doc/fonts/simfang.ttf', drop_score=0.5, e2e_algorithm='PGNet', e2e_model_dir=None, e2e_limit_side_len=768, e2e_limit_type='max', e2e_pgnet_score_thresh=0.5, e2e_char_dict_path='./ppocr/utils/ic15_dict.txt', e2e_pgnet_valid_set='totaltext', e2e_pgnet_mode='fast', use_angle_cls=False, cls_model_dir=None, cls_image_shape='3, 48, 192', label_list=['0', '180'], cls_batch_num=6, cls_thresh=0.9, enable_mkldnn=False, cpu_threads=10, use_pdserving=False, warmup=False, sr_model_dir=None, sr_image_shape='3, 32, 128', sr_batch_num=1, draw_img_save_dir='./inference_results', save_crop_res=False, crop_res_save_dir='./output', use_mp=False, total_process_num=1, process_id=0, benchmark=False, save_log_path='./log_output/', show_log=True, use_onnx=False, return_word_box=False, output='./output', table_max_len=488, table_algorithm='TableAttn', table_model_dir='C:\\Users\\mm/.paddleocr/whl\\table\\ch_ppstructure_mobile_v2.0_SLANet_infer', merge_no_span_structure=True, table_char_dict_path='D:\\anaconda3\\envs\\paddlepaddle\\lib\\site-packages\\paddleocr\\ppocr\\utils\\dict\\table_structure_dict_ch.txt', formula_algorithm='LaTeXOCR', formula_model_dir='C:\\Users\\mm/.paddleocr/whl\\formula\\rec_latex_ocr_infer', formula_char_dict_path='D:\\anaconda3\\envs\\paddlepaddle\\lib\\site-packages\\paddleocr\\ppocr\\utils\\dict\\latex_ocr_tokenizer.json', formula_batch_num=1, layout_model_dir='C:\\Users\\mm/.paddleocr/whl\\layout\\picodet_lcnet_x1_0_fgd_layout_cdla_infer', layout_dict_path='D:\\anaconda3\\envs\\paddlepaddle\\lib\\site-packages\\paddleocr\\ppocr\\utils\\dict\\layout_dict\\layout_cdla_dict.txt', layout_score_threshold=0.5, layout_nms_threshold=0.5, kie_algorithm='LayoutXLM', ser_model_dir=None, re_model_dir=None, use_visual_backbone=True, ser_dict_path='../train_data/XFUND/class_list_xfun.txt', ocr_order_method=None, mode='structure', image_orientation=True, layout=True, table=True, formula=False, ocr=True, recovery=False, recovery_to_markdown=False, use_pdf2docx_api=False, invert=False, binarize=False, alphacolor=(255, 255, 255), lang='ch', det=True, rec=True, type='structure', savefile=False, ocr_version='PP-OCRv4', structure_version='PP-StructureV2')
Traceback (most recent call last):
  File "D:\anaconda3\envs\paddlepaddle\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\anaconda3\envs\paddlepaddle\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\anaconda3\envs\paddlepaddle\Scripts\paddleocr.exe\__main__.py", line 7, in <module>
    sys.exit(main())
  File "D:\anaconda3\envs\paddlepaddle\lib\site-packages\paddleocr\paddleocr.py", line 958, in main
    engine = PPStructure(**(args.__dict__))
  File "D:\anaconda3\envs\paddlepaddle\lib\site-packages\paddleocr\paddleocr.py", line 894, in __init__
    super().__init__(params)
  File "D:\anaconda3\envs\paddlepaddle\lib\site-packages\paddleocr\ppstructure\predict_system.py", line 53, in __init__
    self.image_orientation_predictor = paddleclas.PaddleClas(
  File "D:\anaconda3\envs\paddlepaddle\lib\site-packages\paddleclas\paddleclas.py", line 610, in __init__
    self.predictor = ClsPredictor(self._config)
  File "D:\anaconda3\envs\paddlepaddle\lib\site-packages\paddleclas\deploy\python\predict_cls.py", line 28, in __init__
    super().__init__(config["Global"])
  File "D:\anaconda3\envs\paddlepaddle\lib\site-packages\paddleclas\deploy\utils\predictor.py", line 37, in __init__
    self.predictor, self.config = self.create_paddle_predictor(
  File "D:\anaconda3\envs\paddlepaddle\lib\site-packages\paddleclas\deploy\utils\predictor.py", line 108, in create_paddle_predictor
    predictor = create_predictor(config)
RuntimeError: (NotFound) Cannot open file C:\Users\mm/.paddleclas/inference_model\PULC\text_image_orientation, please confirm whether the file is normal.
  [Hint: Expected static_cast<bool>(fin.is_open()) == true, but received static_cast<bool>(fin.is_open()):0 != true:1.] (at ..\paddle\fluid\inference\api\analysis_predictor.cc:2578)

但是C:\Users\mm.paddleclas\inference_model\PULC\text_image_orientation
这个目录有
而且里面也有3个模型文件

🏃‍♂️ Environment (运行环境)

python3.10
paddlepaddle-gpu 2.6.1
paddleclas 2.6.0
paddleocr 2.9.1

🌰 Minimal Reproducible Example (最小可复现问题的Demo)

paddleocr --image_dir=C:\Users\mm\Downloads\OCR\1.png --type=structure --image_orientation=true

@GreatV
Copy link
Collaborator

GreatV commented Nov 23, 2024

设置一下环境变量 linux: export FLAGS_enable_pir_api=0 windows cmd: set FLAGS_enable_pir_api=0

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