请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
- 系统环境/System Environment:debian 11
- 版本号/Version:Paddle:2.5.1 PaddleOCR:2.7.0.1 问题相关组件/Related components:cuda
- 运行指令/Command Code:
python huifu.py
- 完整代码:
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:
```key
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:
File "tools/export_model.py", line 288, in <module>
main()
File "tools/export_model.py", line 284, in main
model, arch_config, save_path, logger, input_shape=input_shape)
File "tools/export_model.py", line 197, in export_single_model
paddle.jit.save(model, save_path)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/jit.py", line 629, in wrapper
func(layer, path, input_spec, **configs)
File "/usr/local/lib/python3.7/dist-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/wrapped_decorator.py", line 25, in __impl__
return wrapped_func(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/base.py", line 51, in __impl__
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/jit.py", line 857, in save
inner_input_spec, with_hook=with_hook)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 528, in concrete_program_specify_input_spec
*desired_input_spec, with_hook=with_hook)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 436, in get_concrete_program
concrete_program, partial_program_layer = self._program_cache[cache_key]
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 801, in __getitem__
self._caches[item_id] = self._build_once(item)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 790, in _build_once
**cache_key.kwargs)
File "/usr/local/lib/python3.7/dist-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/wrapped_decorator.py", line 25, in __impl__
return wrapped_func(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/base.py", line 51, in __impl__
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 733, in from_func_spec
outputs = static_func(*inputs)
File "/tmp/tmpjvb2gofp.py", line 28, in forward
false_fn_1, (x,), (x,), (x,))
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 211, in convert_ifelse
out = _run_py_ifelse(pred, true_fn, false_fn, true_args, false_args)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 257, in _run_py_ifelse
return true_fn(*true_args) if pred else false_fn(*false_args)
File "/workspace/huangjun12/Projects/PP-OCRv4/pr/check_acc/PaddleOCR/ppocr/modeling/architectures/base_model.py", line 86, in forward
x = self.backbone(x)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/layers.py", line 930, in __call__
return self._dygraph_call_func(*inputs, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/layers.py", line 915, in _dygraph_call_func
outputs = self.forward(*inputs, **kwargs)
File "/tmp/tmpsr4zekry.py", line 45, in forward
for_loop_condition_0, for_loop_body_0, [__for_loop_var_index_0, i, x])
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 45, in convert_while_loop
loop_vars = _run_py_while(cond, body, loop_vars)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 59, in _run_py_while
loop_vars = body(*loop_vars)
File "/workspace/huangjun12/Projects/PP-OCRv4/pr/check_acc/PaddleOCR/ppocr/modeling/backbones/rec_hgnet.py", line 252, in forward
x = stage(x)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/layers.py", line 930, in __call__
return self._dygraph_call_func(*inputs, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/layers.py", line 915, in _dygraph_call_func
outputs = self.forward(*inputs, **kwargs)
File "/workspace/huangjun12/Projects/PP-OCRv4/pr/check_acc/PaddleOCR/ppocr/modeling/backbones/rec_hgnet.py", line 172, in forward
x = self.blocks(x)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/layers.py", line 930, in __call__
return self._dygraph_call_func(*inputs, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/layers.py", line 915, in _dygraph_call_func
outputs = self.forward(*inputs, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/container.py", line 98, in forward
input = layer(input)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/layers.py", line 930, in __call__
return self._dygraph_call_func(*inputs, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/layers.py", line 915, in _dygraph_call_func
outputs = self.forward(*inputs, **kwargs)
File "/workspace/huangjun12/Projects/PP-OCRv4/pr/check_acc/PaddleOCR/ppocr/modeling/backbones/rec_hgnet.py", line 125, in forward
x = self.att(x)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/layers.py", line 930, in __call__
return self._dygraph_call_func(*inputs, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/layers.py", line 915, in _dygraph_call_func
outputs = self.forward(*inputs, **kwargs)
File "/workspace/huangjun12/Projects/PP-OCRv4/pr/check_acc/PaddleOCR/ppocr/modeling/backbones/rec_hgnet.py", line 76, in forward
x = self.conv(x)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/layers.py", line 930, in __call__
return self._dygraph_call_func(*inputs, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/dygraph/layers.py", line 915, in _dygraph_call_func
outputs = self.forward(*inputs, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/paddle/nn/layer/conv.py", line 678, in forward
use_cudnn=self._use_cudnn)
File "/usr/local/lib/python3.7/dist-packages/paddle/nn/functional/conv.py", line 169, in _conv_nd
type=op_type, inputs=inputs, outputs=outputs, attrs=attrs)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/layer_helper.py", line 44, in append_op
return self.main_program.current_block().append_op(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/framework.py", line 3621, in append_op
attrs=kwargs.get("attrs", None))
File "/usr/local/lib/python3.7/dist-packages/paddle/fluid/framework.py", line 2635, in __init__
for frame in traceback.extract_stack():
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]