PaddleHub icon indicating copy to clipboard operation
PaddleHub copied to clipboard

chinese_ocr_db_crnn_mobile 在recognize_test识别图片时报段错误信息

Open startfromzero0 opened this issue 2 years ago • 4 comments

  • 版本、环境信息:    1)PaddlePaddle版本:2.2.2.post101 PaddleHub版本:2.2.0 chinese_ocr_db_crnn_mobile 版本:1.1.2    2)GPU:Driver Version 418.40.04.
    CUDA Version 10.1

   3)系统环境:SUSE 12 SP5 4)容器信息:docker version 18.09.1, 系统 centos7, gcc version 4.8.5, python version 3.8.0 CDUATOOLKIT release 10.1,V10.1.105 CUDNN Version 8.0.4

问题描述:

/root/.paddlehub/modules/chinese_text_detection_db_mobile/module.py(224)detect_text() -> self.predictor.zero_copy_run() ….. …/site-packages/paddlehub/module/module.py(100)getattribute()-><paddle.fluid…x7fafce033070 ->return _attr

代码运行到此处,再次step时,报如下错误:

————————————————— C++ Traceback (most recent call last): ————————————————— No stack trace in paddle, may be caused by external reasons.

———————————— Error Message Summary: ———————————— FatalError: Segmentation fault is detected by the operating system. [TimeInfo: *** Aborted at 16648627218 (unix time) try “date -d @16648627218” if you are using GNU date *** ] [SignalInfo: *** SIGSEGV (@0x0) received by PID 45676 (TID 0x7f6af4940740) from PID 0 *** ]

Segmentation fault (core dumped)

使用的脚本:

import os
os.environ[“CUDA_VISIBLE_DEVICES”]=“0”
import paddlehub as hub
import cv2

ocr = hub.Module(name=“chinese_ocr_db_crnn_mobile”)
img = cv2.imread(“path/1.jpg”)
result = ocr.recognize_text(images=[img], use_gpu=True)
print(result)

startfromzero0 avatar Mar 31 '22 03:03 startfromzero0

这个错误一般是由于cuda和cudnn及paddle版本不匹配导致的,建议从这个方向排查原因。你可以尝试其他的ocr模型看是否都报这个错误,如果都是这个错误,建议cudnn换成7.6.5

haoyuying avatar Mar 31 '22 12:03 haoyuying

问题直接使用官方的cuda 镜像,这个为啥会版本不一致呢?

songjiayang avatar Apr 18 '22 12:04 songjiayang

问题直接使用官方的cuda 镜像,这个为啥会版本不一致呢?

我的是因为cudnn使用的是8.0.4,虽然paddlepaddle官网说明支持的是CUDNN>=7.6.5,但我使用cudnn使用的是8.0.4时报错,使用7.6.5的时候就没有报这个错了

startfromzero0 avatar Apr 18 '22 12:04 startfromzero0

确实,问题是我安装的镜像版本和宿主机驱动不匹配:

  1. 宿主机cuda 驱动只支持到 v11.0
  2. 我下载的是 paddlehub cuda 11.2 的镜像,然后报错。
  3. 降级到 paddlehub cuda 10.2 镜像即可。

songjiayang avatar Apr 19 '22 08:04 songjiayang