-
Notifications
You must be signed in to change notification settings - Fork 640
Segmentation Error when running fast deploy #2630
-
I am getting segmentation exception while running the fast deploy predict method in aws lamdba but not in my local machine, the exception message is:
Runtime exited with error: signal: segmentation fault.
it is coming exactly when i am calling the predict function like below:
def initialize_ocr():
folder = os.path.join(folder_path, "inference/")
det_model = f'{folder}det_onnx/model.onnx'
rec_model = f'{folder}rec_onnx/model.onnx'
rec_dict = f'{folder}rec_onnx/dict.txt'
opt = fd.RuntimeOption()
opt.set_cpu_thread_num(1)
# opt.paddle_infer_option.enable_mkldnn = True
det = fd.vision.ocr.DBDetector(det_model, '', runtime_option=opt, model_format=fd.ModelFormat.ONNX)
rec = fd.vision.ocr.Recognizer(rec_model, '', rec_dict, runtime_option=opt, model_format=fd.ModelFormat.ONNX)
return fd.vision.ocr.PPOCRv4(det, None, rec)
ocr = initialize_ocr()
out = ocr.predict("captcha.png")
Beta Was this translation helpful? Give feedback.