PaddlePaddle / PaddlePaddle/FastDeploy
fd.vision.ocr.PPOCRv3初始化模型后调用predict(im)无返回,报错:Process finished with exit code -1073741819 (0xC0000005)
Open
@rainyfly is already working on this.
Since Jul 18, 2024.
- Dominant language
- Python
- Stars
- 3.7k
- Forks
- 756
- Avg merge
- 19h 28m
- Merged PRs (30d)
- 4
Description
温馨提示:根据社区不完全统计,按照模板提问,可以加快回复和解决问题的速度
环境
- 【FastDeploy版本】:fastdeploy-python-1.0.7
- 【编译命令】如果您是自行编译的FastDeploy,请说明您的编译方式(参数命令)
- 【系统平台】: Windows x64(Windows10)
- 【硬件】: CPU
- 【编译语言】:Python(3.8)
问题日志及出现问题的操作流程
- 【模型跑不通】
- 问题说明:fd.vision.ocr.PPOCRv3(det_model=build_det_model(), rec_model=build_rec_model());初始化模型后调用predict(im)无返回
- 报错:Process finished with exit code -1073741819 (0xC0000005)
下面是我的代码:
import fastdeploy as fd
import cv2
import os
def build_det_model():
det_model_file = "./model/det_db_inference/inference.pdmodel"
det_params_file = "./model/det_db_inference/inference.pdiparams"
# Set the runtime option
det_option = fd.RuntimeOption()
det_option.use_cpu()
# det_option.use_openvino_backend()
# Create the det_model
det_model = fd.vision.ocr.DBDetector(
det_model_file, det_params_file, runtime_option=det_option)
# Set the preporcessing parameters
det_model.preprocessor.max_side_len = 960
det_model.postprocessor.det_db_thresh = 0.3
det_model.postprocessor.det_db_box_thresh = 0.6
det_model.postprocessor.det_db_unclip_ratio = 1.5
det_model.postprocessor.det_db_score_mode = "slow"
det_model.postprocessor.use_dilation = False
return det_model
def build_rec_model():
rec_model_file = "./model/rec_ppocr_v3_distillation/Teacher/inference.pdmodel"
rec_params_file = "./model/rec_ppocr_v3_distillation/Teacher/inference.pdiparams"
rec_label_file = "./model/rec_ppocr_v3_distillation/lesson_letter.txt"
# Set the runtime option
rec_option = fd.RuntimeOption()
rec_option.use_cpu()
# rec_option.use_openvino_backend()
rec_model = fd.vision.ocr.Recognizer(
rec_model_file, rec_params_file, rec_label_file, runtime_option=rec_option)
rec_model.rec_image_shape = [3, 48, 48]
return rec_model
if __name__ == '__main__':
im = cv2.imread("./imgs/19.png")
ppocr_v3 = fd.vision.ocr.PPOCRv3(det_model=build_det_model(), rec_model=build_rec_model())
result = ppocr_v3.predict(im)
print(result)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.