ocr使用gpu识别的时候,不时会有超长耗时出现
🔎 Search before asking
- [x] I have searched the PaddleOCR Docs and found no similar bug report.
- [x] I have searched the PaddleOCR Issues and found no similar bug report.
- [x] I have searched the PaddleOCR Discussions and found no similar bug report.
🐛 Bug (问题描述)
在进行ocr识别的时候,有超长的数据同步耗时,这个时间太不正常,给的图片都是小图片,512尺寸以下,希望知道如何解决,复现几率很高
🏃♂️ Environment (运行环境)
Linux kas-job-35417 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ free -m total used free shared buff/cache available Mem: 515631 223455 22462 4648 269714 284177 Swap: 0 0 0
$ nvidia-smi +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 535.104.05 Driver Version: 535.104.05 CUDA Version: 12.2 | |-----------------------------------------+----------------------+----------------------+
$ pip freeze |grep paddle paddleocr==2.10.0 paddlepaddle-gpu==2.6.2
🌰 Minimal Reproducible Example (最小可复现问题的Demo)
def get_ocr_ins()->PaddleOCR: key = os.getpid() try: handler_locker.acquire() if key not in mutil_process_handler.keys(): mutil_process_handler[key] = PaddleOCR( show_log=False, det_model_dir=get_env_config(STATIC_CONFIG.OCR_DET_MODEL_PATH), cls_model_dir=get_env_config(STATIC_CONFIG.OCR_CLS_MODEL_PATH), rec_model_dir=get_env_config(STATIC_CONFIG.OCR_REC_MODEL_PATH), use_angle_cls=True, use_gpu=get_env_config(STATIC_CONFIG.OCR_USE_GPU,"TRUE")=="TRUE", det_limit_side_len = 480, det_db_box_thresh=0.3, ) handler = mutil_process_handler[key] finally: handler_locker.release() return handler
ocr = get_ocr_ins() result = ocr.ocr(img_array)