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

更换了高精度的检测模型det和识别模型rec以后,cuda会报错: [Hint: 'CUDNN_STATUS_NOT_SUPPORTED'. The functionality requested is not presently supported by cuDNN. ] #6

Open
shiyutang opened this issue Aug 28, 2023 · 1 comment

Comments

@shiyutang
Copy link
Owner

shiyutang commented Aug 28, 2023

import os
import cv2
from paddleocr import PPStructure,save_structure_res
from paddleocr.ppstructure.recovery.recovery_to_doc import sorted_layout_boxes, convert_info_docx

det_model_dir='./inference/detv4_teacher_inference'
rec_model_dir='./inference/ch_PP-OCRv4_rec_server_infer'

table_engine = PPStructure(recovery=True,det_model_dir=det_model_dir,rec_model_dir=rec_model_dir)

save_folder = './output/huifu'
img_path = '微信截图_20230810150058.png'
img = cv2.imread(img_path)
result = table_engine(img)
save_structure_res(result, save_folder, os.path.basename(img_path).split('.')[0])

for line in result:
    line.pop('img')
    print(line)

h, w, _ = img.shape
res = sorted_layout_boxes(result, w)
convert_info_docx(img, res, save_folder, os.path.basename(img_path).split('.')[0])
  • 完整报错/Complete Error Message:
root@38b3b7920d22:/app/test# python huifu.py 
download https://paddleocr.bj.bcebos.com/PP-OCRv4/chinese/ch_PP-OCRv4_det_server_infer.tar to /root/.paddleocr/whl/det/ch/ch_PP-OCRv4_det_server_infer/ch_PP-OCRv4_det_server_infer.tar
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 116M/116M [01:43<00:00, 1.11MiB/s]
download https://paddleocr.bj.bcebos.com/PP-OCRv4/chinese/ch_PP-OCRv4_rec_server_infer.tar to /root/.paddleocr/whl/rec/ch/ch_PP-OCRv4_rec_server_infer/ch_PP-OCRv4_rec_server_infer.tar
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 92.4M/92.4M [01:26<00:00, 1.07MiB/s]
[2023/08/28 06:30:03] ppocr DEBUG: Namespace(help='==SUPPRESS==', use_gpu=True, use_xpu=False, use_npu=False, ir_optim=True, use_tensorrt=False, min_subgraph_size=15, precision='fp32', gpu_mem=500, gpu_id=0, image_dir=None, page_num=0, det_algorithm='DB', det_model_dir='/root/.paddleocr/whl/det/ch/ch_PP-OCRv4_det_server_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='/root/.paddleocr/whl/rec/ch/ch_PP-OCRv4_rec_server_infer', rec_image_inverse=True, rec_image_shape='3, 48, 320', rec_batch_num=6, max_text_length=25, rec_char_dict_path='/usr/local/lib/python3.10/site-packages/paddleocr-2.7.0.1-py3.10.egg/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, output='./output', table_max_len=488, table_algorithm='TableAttn', table_model_dir='/root/.paddleocr/whl/table/ch_ppstructure_mobile_v2.0_SLANet_infer', merge_no_span_structure=True, table_char_dict_path='/usr/local/lib/python3.10/site-packages/paddleocr-2.7.0.1-py3.10.egg/paddleocr/ppocr/utils/dict/table_structure_dict_ch.txt', layout_model_dir='/root/.paddleocr/whl/layout/picodet_lcnet_x1_0_fgd_layout_cdla_infer', layout_dict_path='/usr/local/lib/python3.10/site-packages/paddleocr-2.7.0.1-py3.10.egg/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=False, layout=True, table=True, ocr=True, recovery=True, use_pdf2docx_api=False, invert=False, binarize=False, alphacolor=(255, 255, 255), lang='ch', det=True, rec=True, type='ocr', ocr_version='PP-OCRv4', structure_version='PP-StructureV2')
Traceback (most recent call last):
  File "/app/test/huifu.py", line 16, in <module>
    result = table_engine(img)
  File "/usr/local/lib/python3.10/site-packages/paddleocr-2.7.0.1-py3.10.egg/paddleocr/paddleocr.py", line 759, in __call__
    res, _ = super().__call__(
  File "/usr/local/lib/python3.10/site-packages/paddleocr-2.7.0.1-py3.10.egg/paddleocr/ppstructure/predict_system.py", line 140, in __call__
    filter_boxes, filter_rec_res, ocr_time_dict = self.text_system(
  File "/usr/local/lib/python3.10/site-packages/paddleocr-2.7.0.1-py3.10.egg/paddleocr/tools/infer/predict_system.py", line 76, in __call__
    dt_boxes, elapse = self.text_detector(img)
  File "/usr/local/lib/python3.10/site-packages/paddleocr-2.7.0.1-py3.10.egg/paddleocr/tools/infer/predict_det.py", line 245, in __call__
    self.predictor.run()
OSError: In user code:

    ExternalError: CUDNN error(9), CUDNN_STATUS_NOT_SUPPORTED. 
      [Hint: 'CUDNN_STATUS_NOT_SUPPORTED'.  The functionality requested is not presently supported by cuDNN.  ] (at ../paddle/phi/kernels/fusion/gpu/conv_fusion_kernel.cu:616)
      [operator < conv2d_fusion > error]

我们提供了AceIssueSolver来帮助你解答问题,你是否想要它来解答(请填写yes/no)?/We provide AceIssueSolver to solve issues, do you want it? (Please write yes/no): yes

请尽量不要包含图片在问题中/Please try to not include the image in the issue.

@THE-FLIER
Copy link

一样问题,求解答

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