PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
42.92k stars 7.71k forks source link

The third-party dynamic library (cudnn64_7.dll) that Paddle depends on is not configured #10210

Closed divastar closed 8 months ago

divastar commented 1 year ago

installed python -m pip install paddlepaddle-gpu pip install "paddleocr>=2.0.1"

RuntimeError: (PreconditionNotMet) The third-party dynamic library (cudnn64_7.dll) that Paddle depends on is not configured correctly. (error code is 126)

(ocr) PS C:PADDLEOCR> nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2023 NVIDIA Corporation Built on Mon_Apr__3_17:36:15_Pacific_Daylight_Time_2023 Cuda compilation tools, release 12.1, V12.1.105 Build cuda_12.1.r12.1/compiler.32688072_0

cudnn-windows-x86_64-8.9.2.26_cuda12-archive installed

Complete Error Message: PADDLEOCR> paddleocr --image_dir crop.jpg --det false --lang en C:\Users\k\anaconda3\envs\pocr1\lib\site-packages\pkg_resources__init.py:121: DeprecationWarning: pkg_resources is deprecated as an API warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning) C:\Users\k\anaconda3\envs\pocr1\lib\site-packages\pkg_resources__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('mpl_toolkits'). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) C:\Users\k\anaconda3\envs\pocr1\lib\site-packages\pkg_resources\init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('google'). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages declare_namespace(pkg) [2023/06/19 18:06:50] 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, image_dir='crop.jpg', page_num=0, det_algorithm='DB', det_model_dir='C:\Users\k/.paddleocr/whl\det\en\en_PP-OCRv3_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\k/.paddleocr/whl\rec\en\en_PP-OCRv3_rec_infer', rec_image_inverse=True, rec_image_shape='3, 48, 320', rec_batch_num=6, max_text_length=25, rec_char_dict_path='C:\Users\k\anaconda3\envs\pocr1\lib\site-packages\paddleocr\ppocr\utils\en_dict.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='C:\Users\k/.paddleocr/whl\cls\ch_ppocr_mobile_v2.0_cls_infer', 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=None, merge_no_span_structure=True, table_char_dict_path=None, layout_model_dir=None, layout_dict_path=None, 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=False, use_pdf2docx_api=False, lang='en', det=False, rec=True, type='ocr', ocr_version='PP-OCRv3', structure_version='PP-StructureV2') [2023/06/19 18:06:57] ppocr INFO: **crop.jpg** Traceback (most recent call last): File "C:\Users\k\anaconda3\envs\pocr1\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\k\anaconda3\envs\pocr1\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\k\anaconda3\envs\pocr1\Scripts\paddleocr.exe\main.py", line 7, in File "C:\Users\k\anaconda3\envs\pocr1\lib\site-packages\paddleocr\paddleocr.py", line 673, in main result = engine.ocr(img_path, File "C:\Users\k\anaconda3\envs\pocr1\lib\site-packages\paddleocr\paddleocr.py", line 577, in ocr rec_res, elapse = self.text_recognizer(img) File "C:\Users\k\anaconda3\envs\pocr1\lib\site-packages\paddleocr\tools\infer\predict_rec.py", line 608, in call__ self.input_tensor.copy_from_cpu(norm_img_batch) File "C:\Users\k\anaconda3\envs\pocr1\lib\site-packages\paddle\fluid\inference\wrapper.py", line 38, in tensor_copy_from_cpu self.copy_from_cpu_bind(data) RuntimeError: (PreconditionNotMet) The third-party dynamic library (cudnn64_7.dll) that Paddle depends on is not configured correctly. (error code is 126) Suggestions:

  1. Check if the third-party dynamic library (e.g. CUDA, CUDNN) is installed correctly and its version is matched with paddlepaddle you installed.
  2. Configure third-party dynamic library environment variables as follows:
    • Linux: set LD_LIBRARY_PATH by export LD_LIBRARY_PATH=...
    • Windows: set PATH by `set PATH=XXX; (at ..\paddle\phi\backends\dynload\dynamic_loader.cc:305)
a-3isa commented 11 months ago

did you solve this ?

github-actions[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

DimIsaev commented 8 months ago

where is the solution?

tzktz commented 6 months ago

same issue @tink2123 ..pls rectify

tangh146 commented 4 months ago

nvcc --version to check if cuda toolkit is installed, otherwise follow this tutorial and then restart your computer