Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paddlepaddle 2.6.1,paddlehub 2.4.0,启动报 Illegal instruction (core dumped) 错误 #2331

Open
dp9212 opened this issue Jun 28, 2024 · 0 comments
Assignees

Comments

@dp9212
Copy link

dp9212 commented Jun 28, 2024

CPU推理,paddlepaddle 2.6.1,paddlehub 2.4.0,启动报 Illegal instruction (core dumped) 错误

以下是部署过程:

$ docker pull registry.baidubce.com/paddlepaddle/paddle:2.5.1

$ docker run -p 8866:8866 --name paddleOCR-v4-demo -itd registry.baidubce.com/paddlepaddle/paddle:2.5.1 /bin/bash

$ docker exec -it <容器ID> /bin/bash

#======================================================================

同步下来的PaddleOCR版本为2.8.0
$ git clone https://github.com/PaddlePaddle/PaddleOCR.git

$ cd PaddleOCR/
$ pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
$ pip install paddlehub==2.4.0 --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple/

#======================================================================

$ cd /opt/
$ mkdir -p /opt/PaddleOCR/inference/

文本检测模型
$ wget https://paddleocr.bj.bcebos.com/PP-OCRv4/chinese/ch_PP-OCRv4_det_infer.tar && tar -xf ch_PP-OCRv4_det_infer.tar -C /opt/PaddleOCR/inference/

文本方向分类模型
$ wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar && tar -xf ch_ppocr_mobile_v2.0_cls_infer.tar -C /opt/PaddleOCR/inference/

文本识别模型
$ wget https://paddleocr.bj.bcebos.com/PP-OCRv4/chinese/ch_PP-OCRv4_rec_infer.tar && tar -xf ch_PP-OCRv4_rec_infer.tar -C /opt/PaddleOCR/inference/

基于SLANet的中文表格识别模型
$ wget https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/ch_ppstructure_mobile_v2.0_SLANet_infer.tar && tar -xf ch_ppstructure_mobile_v2.0_SLANet_infer.tar -C /opt/PaddleOCR/inference/

#======================================================================

修改本地模型路径配置
$ vim PaddleOCR/deploy/hubserving/ocr_system/params.py

3阶段串联修改位置
`def read_params():
cfg = Config()

# params for text detector
cfg.det_algorithm = "DB"
# 模型路径
# cfg.det_model_dir = "./inference/ch_PP-OCRv3_det_infer/"
cfg.det_model_dir = "/opt/PaddleOCR/inference/ch_PP-OCRv4_det_infer/"

# params for text recognizer
cfg.rec_algorithm = "CRNN"
# 模型路径
# cfg.rec_model_dir = "./inference/ch_PP-OCRv3_rec_infer/"
cfg.rec_model_dir = "/opt/PaddleOCR/inference/ch_PP-OCRv4_rec_infer/"

# params for text classifier
cfg.use_angle_cls = True
# 模型路径
# cfg.cls_model_dir = "./inference/ch_ppocr_mobile_v2.0_cls_infer/"
cfg.cls_model_dir = "/opt/PaddleOCR/inference/ch_ppocr_mobile_v2.0_cls_infer/"`

表格识别
$ vim PaddleOCR/deploy/hubserving/structure_table/params.py

修改位置
`def read_params():
cfg = pp_ocr_read_params()

# params for table structure model
cfg.table_max_len = 488
# 模型路径
cfg.table_model_dir = "/opt/PaddleOCR/inference/ch_ppstructure_mobile_v2.0_SLANet_infer/"
# 语言字典,根据模型选择
# 字典文件在 PaddleOCR/ppocr/utils/dict/ 目录
cfg.table_char_dict_path = "./ppocr/utils/dict/table_structure_dict_ch.txt"
cfg.show_log = False
return cfg`

#======================================================================

$ pip uninstall protobuf -y
$ pip install protobuf==3.20.2 -i https://pypi.tuna.tsinghua.edu.cn/simple/

#======================================================================
$ cd /opt/PaddleOCR/

文本检测+文本方向分类+文本识别3阶段串联服务
$ hub install deploy/hubserving/ocr_system/

表格识别服务
$ hub install deploy/hubserving/structure_table

#======================================================================

报错:Illegal instruction (core dumped)
$ hub serving start -m ocr_system structure_table -p 8866

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants