PaddlePaddle / Serving

A flexible, high-performance carrier for machine learning models(『飞桨』服务化部署框架)
Apache License 2.0
899 stars 250 forks source link

client_type 为 local_predictor 或 grpc时报错 #1263

Closed zouxiaoshi closed 8 months ago

zouxiaoshi commented 3 years ago

如下配置文件中 client_type 为 local_predictor 或 grpc时报错

#build_dag_each_worker, False,框架在进程内创建一条DAG;True,框架会每个进程内创建多个独立的DAG
build_dag_each_worker: false

dag:
    #op资源类型, True, 为线程模型;False,为进程模型
    is_thread_op: False

    #重试次数
    retry: 1

    #使用性能分析, True,生成Timeline性能数据,对性能有一定影响;False为不使用
    use_profile: False

    tracer:
        interval_s: 10
op:
    rec:
        #并发数,is_thread_op=True时,为线程并发;否则为进程并发
        concurrency: 1

        #超时时间, 单位ms
        timeout: -1

        #Serving交互重试次数,默认不重试
        retry: 1

        #当op配置没有server_endpoints时,从local_service_conf读取本地服务配置
        local_service_conf:

            #client类型,包括brpc, grpc和local_predictor。local_predictor不启动Serving服务,进程内预测
            client_type: local_predictor

            #rec模型路径
            model_config: ../output/ppocr_rec_mobile_2.0_serving #ocr_rec_model

            #Fetch结果列表,以client_config中fetch_var的alias_name为准
            fetch_list: ["save_infer_model/scale_0.tmp_1"] #["ctc_greedy_decoder_0.tmp_0", "softmax_0.tmp_0"] 

            #计算硬件ID,当devices为""或不写时为CPU预测;当devices为"0", "0,1,2"时为GPU预测,表示使用的GPU卡
            devices: "0"

            ir_optim: True

环境: paddle-serving-app 0.2.0
paddle-serving-client 0.5.0
paddle-serving-server-gpu 0.5.0.post10
paddlepaddle-gpu 2.0.1.post100

模型:

wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar 
python3 -m paddle_serving_client.convert --dirname ./ch_ppocr_mobile_v2.0_rec_infer/ \
                                         --model_filename inference.pdmodel          \
                                         --params_filename inference.pdiparams       \
                                         --serving_server ../output/ppocr_rec_mobile_2.0_serving/  \
                                         --serving_client ../output/ppocr_rec_mobile_2.0_client/

报错: client_type 为grpc时 报错信息如下

WARNING 2021-05-25 08:27:02,472 [pipeline_server.py:482] [CONF] client_type not set, use default: brpc
WARNING 2021-05-25 08:27:02,472 [pipeline_server.py:482] [CONF] channel_size not set, use default: 0
WARNING 2021-05-25 08:27:02,472 [pipeline_server.py:482] [CONF] batch_size not set, use default: 1
WARNING 2021-05-25 08:27:02,473 [pipeline_server.py:482] [CONF] auto_batching_timeout not set, use default: -1
WARNING 2021-05-25 08:27:02,473 [pipeline_server.py:482] [CONF] workdir not set, use default: 
WARNING 2021-05-25 08:27:02,473 [pipeline_server.py:482] [CONF] thread_num not set, use default: 2
WARNING 2021-05-25 08:27:02,473 [pipeline_server.py:482] [CONF] device_type not set, use default: -1
WARNING 2021-05-25 08:27:02,473 [pipeline_server.py:482] [CONF] mem_optim not set, use default: True
WARNING 2021-05-25 08:27:02,474 [operator.py:126] rec Because auto_batching_timeout <= 0 or batch_size == 1, set auto_batching_timeout to None.
INFO 2021-05-25 08:27:02,474 [operator.py:151] local_service_conf: {'client_type': 'grpc', 'model_config': '../output/ppocr_rec_mobile_2.0_serving', 'fetch_list': ['save_infer_model/scale_0.tmp_1'], 'devices': '0', 'ir_optim': True, 'workdir': '', 'thread_num': 2, 'device_type': -1, 'mem_optim': True}
INFO 2021-05-25 08:27:02,474 [local_service_handler.py:126] Create ports for devices:[0]. Port:[12000]
INFO 2021-05-25 08:27:02,474 [local_service_handler.py:141] Models(../output/ppocr_rec_mobile_2.0_serving) will be launched by device gpu. use_gpu:True, use_trt:False, use_lite:False, use_xpu:False, device_type:-1, devices:[0], mem_optim:True, ir_optim:True, use_profile:False, thread_num:2, client_type:grpc, fetch_names:None
INFO 2021-05-25 08:27:02,506 [operator.py:221] rec 
    input_ops: @DAGExecutor,
    server_endpoints: ['127.0.0.1:12000']
    fetch_list: ['save_infer_model/scale_0.tmp_1']
    client_config: ../output/ppocr_rec_mobile_2.0_serving/serving_server_conf.prototxt
    concurrency: 1,
    timeout(s): -1,
    retry: 1,
    batch_size: 1,
    auto_batching_timeout(s): None
INFO 2021-05-25 08:27:02,506 [pipeline_server.py:205] ============= PIPELINE SERVER =============
INFO 2021-05-25 08:27:02,507 [pipeline_server.py:206] 
{
    "rpc_port":18090,
    "http_port":9999,
    "worker_num":20,
    "build_dag_each_worker":false,
    "dag":{
        "is_thread_op":false,
        "retry":1,
        "use_profile":false,
        "tracer":{
            "interval_s":10
        },
        "client_type":"brpc",
        "channel_size":0
    },
    "op":{
        "rec":{
            "concurrency":1,
            "timeout":-1,
            "retry":1,
            "local_service_conf":{
                "client_type":"grpc",
                "model_config":"../output/ppocr_rec_mobile_2.0_serving",
                "fetch_list":[
                    "save_infer_model/scale_0.tmp_1"
                ],
                "devices":"0",
                "ir_optim":true,
                "workdir":"",
                "thread_num":2,
                "device_type":-1,
                "mem_optim":true
            },
            "batch_size":1,
            "auto_batching_timeout":-1
        }
    }
}
INFO 2021-05-25 08:27:02,507 [pipeline_server.py:213] -------------------------------------------
INFO 2021-05-25 08:27:02,511 [operator.py:257] Op(rec) use local rpc service at port: [12000]
INFO 2021-05-25 08:27:02,558 [dag.py:493] [DAG] Succ init
INFO 2021-05-25 08:27:02,560 [dag.py:651] ================= USED OP =================
INFO 2021-05-25 08:27:02,560 [dag.py:654] rec
INFO 2021-05-25 08:27:02,560 [dag.py:655] -------------------------------------------
INFO 2021-05-25 08:27:02,604 [dag.py:784] [DAG] Succ build DAG
INFO 2021-05-25 08:27:02,609 [dag.py:816] [DAG] start
INFO 2021-05-25 08:27:02,610 [dag.py:181] [DAG] set in channel succ, name [@DAGExecutor]
INFO 2021-05-25 08:27:02,619 [pipeline_server.py:47] [PipelineServicer] succ init
CRITICAL 2021-05-25 08:27:02,640 [operator.py:1082] [rec|0] failed to init op: <_InactiveRpcError of RPC that terminated with:
    status = StatusCode.UNAVAILABLE
    details = "connections to all backends failing"
    debug_error_string = "{"created":"@1621931222.640109461","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":4165,"referenced_errors":[{"created":"@1621931222.640092495","description":"connections to all backends failing","file":"src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc","file_line":335,"grpc_status":14}]}"
>
Traceback (most recent call last):
  File "/root/miniconda3/lib/python3.8/site-packages/paddle_serving_server_gpu/pipeline/operator.py", line 1079, in _run
    profiler = self._initialize(is_thread_op, concurrency_idx)
  File "/root/miniconda3/lib/python3.8/site-packages/paddle_serving_server_gpu/pipeline/operator.py", line 1249, in _initialize
    self.client = self.init_client(self._client_config,
  File "/root/miniconda3/lib/python3.8/site-packages/paddle_serving_server_gpu/pipeline/operator.py", line 319, in init_client
    client.connect(server_endpoints)
  File "/root/miniconda3/lib/python3.8/site-packages/paddle_serving_client/__init__.py", line 511, in connect
    resp = self.stub_.GetClientConfig(get_client_config_req)
  File "/root/miniconda3/lib/python3.8/site-packages/grpc/_channel.py", line 923, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "/root/miniconda3/lib/python3.8/site-packages/grpc/_channel.py", line 826, in _end_unary_response_blocking
    raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
    status = StatusCode.UNAVAILABLE
    details = "connections to all backends failing"
    debug_error_string = "{"created":"@1621931222.640109461","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":4165,"referenced_errors":[{"created":"@1621931222.640092495","description":"connections to all backends failing","file":"src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc","file_line":335,"grpc_status":14}]}"

local_predictor时报错信息

WARNING 2021-05-25 08:46:07,940 [pipeline_server.py:482] [CONF] client_type not set, use default: brpc
WARNING 2021-05-25 08:46:07,940 [pipeline_server.py:482] [CONF] channel_size not set, use default: 0
WARNING 2021-05-25 08:46:07,940 [pipeline_server.py:482] [CONF] batch_size not set, use default: 1
WARNING 2021-05-25 08:46:07,940 [pipeline_server.py:482] [CONF] auto_batching_timeout not set, use default: -1
WARNING 2021-05-25 08:46:07,940 [pipeline_server.py:482] [CONF] workdir not set, use default: 
WARNING 2021-05-25 08:46:07,940 [pipeline_server.py:482] [CONF] thread_num not set, use default: 2
WARNING 2021-05-25 08:46:07,941 [pipeline_server.py:482] [CONF] device_type not set, use default: -1
WARNING 2021-05-25 08:46:07,941 [pipeline_server.py:482] [CONF] mem_optim not set, use default: True
WARNING 2021-05-25 08:46:07,941 [operator.py:126] rec Because auto_batching_timeout <= 0 or batch_size == 1, set auto_batching_timeout to None.
INFO 2021-05-25 08:46:07,941 [operator.py:151] local_service_conf: {'client_type': 'local_predictor', 'model_config': '../output/ppocr_rec_mobile_2.0_serving', 'fetch_list': ['save_infer_model/scale_0.tmp_1'], 'devices': '0', 'ir_optim': True, 'workdir': '', 'thread_num': 2, 'device_type': -1, 'mem_optim': True}
INFO 2021-05-25 08:46:07,942 [local_service_handler.py:141] Models(../output/ppocr_rec_mobile_2.0_serving) will be launched by device gpu. use_gpu:True, use_trt:False, use_lite:False, use_xpu:False, device_type:-1, devices:[0], mem_optim:True, ir_optim:True, use_profile:False, thread_num:2, client_type:local_predictor, fetch_names:['save_infer_model/scale_0.tmp_1']
INFO 2021-05-25 08:46:07,942 [operator.py:221] rec 
    input_ops: @DAGExecutor,
    server_endpoints: None
    fetch_list: ['save_infer_model/scale_0.tmp_1']
    client_config: ../output/ppocr_rec_mobile_2.0_serving/serving_server_conf.prototxt
    concurrency: 1,
    timeout(s): -1,
    retry: 1,
    batch_size: 1,
    auto_batching_timeout(s): None
INFO 2021-05-25 08:46:07,942 [pipeline_server.py:205] ============= PIPELINE SERVER =============
INFO 2021-05-25 08:46:07,942 [pipeline_server.py:206] 
{
    "rpc_port":18090,
    "http_port":9999,
    "worker_num":20,
    "build_dag_each_worker":false,
    "dag":{
        "is_thread_op":false,
        "retry":1,
        "use_profile":false,
        "tracer":{
            "interval_s":10
        },
        "client_type":"brpc",
        "channel_size":0
    },
    "op":{
        "rec":{
            "concurrency":1,
            "timeout":-1,
            "retry":1,
            "local_service_conf":{
                "client_type":"local_predictor",
                "model_config":"../output/ppocr_rec_mobile_2.0_serving",
                "fetch_list":[
                    "save_infer_model/scale_0.tmp_1"
                ],
                "devices":"0",
                "ir_optim":true,
                "workdir":"",
                "thread_num":2,
                "device_type":-1,
                "mem_optim":true
            },
            "batch_size":1,
            "auto_batching_timeout":-1
        }
    }
}
INFO 2021-05-25 08:46:07,942 [pipeline_server.py:213] -------------------------------------------
INFO 2021-05-25 08:46:07,942 [operator.py:257] Op(rec) use local rpc service at port: []
INFO 2021-05-25 08:46:08,004 [dag.py:493] [DAG] Succ init
INFO 2021-05-25 08:46:08,005 [dag.py:651] ================= USED OP =================
INFO 2021-05-25 08:46:08,005 [dag.py:654] rec
INFO 2021-05-25 08:46:08,005 [dag.py:655] -------------------------------------------
INFO 2021-05-25 08:46:08,063 [dag.py:784] [DAG] Succ build DAG
INFO 2021-05-25 08:46:08,072 [dag.py:816] [DAG] start
INFO 2021-05-25 08:46:08,073 [dag.py:181] [DAG] set in channel succ, name [@DAGExecutor]
INFO 2021-05-25 08:46:08,084 [pipeline_server.py:47] [PipelineServicer] succ init
INFO 2021-05-25 08:46:08,120 [local_service_handler.py:141] Models(../output/ppocr_rec_mobile_2.0_serving) will be launched by device gpu. use_gpu:True, use_trt:False, use_lite:False, use_xpu:False, device_type:-1, devices:[0], mem_optim:True, ir_optim:True, use_profile:False, thread_num:2, client_type:local_predictor, fetch_names:None
INFO 2021-05-25 08:46:08,120 [operator.py:1074] Init cuda env in process 0
INFO 2021-05-25 08:46:08,120 [local_service_handler.py:184] GET_CLIENT : concurrency_idx=0, device_num=1
CRITICAL 2021-05-25 08:46:08,126 [operator.py:1082] [rec|0] failed to init op: load_model_config() got an unexpected keyword argument 'use_lite'
Traceback (most recent call last):
  File "/root/miniconda3/lib/python3.8/site-packages/paddle_serving_server_gpu/pipeline/operator.py", line 1076, in _run
    self.local_predictor = self.service_handler.get_client(
  File "/root/miniconda3/lib/python3.8/site-packages/paddle_serving_server_gpu/pipeline/local_service_handler.py", line 190, in get_client
    self._local_predictor_client.load_model_config(
TypeError: load_model_config() got an unexpected keyword argument 'use_lite'

源码如下

from paddle_serving_server_gpu.web_service import WebService, Op
import logging
import numpy as np
import cv2
import base64
from ocr_reader import OCRReader
from paddle_serving_app.reader import GetRotateCropImage, SortedBoxes

_LOGGER = logging.getLogger()

class RecOp(Op):
    def init_op(self):
        self.ocr_reader = OCRReader(
            char_dict_path="./ppocr_keys_v1.txt")

        self.get_rotate_crop_image = GetRotateCropImage()
        self.sorted_boxes = SortedBoxes()

    def preprocess(self, input_dicts, data_id, log_id):
        (_, input_dict), = input_dicts.items()
        img_lst = []
        max_wh_ratio = 0
        for img_byte in input_dict["images"]:
            data = base64.b64decode(img_byte.encode('utf8'))
            data = np.fromstring(data, np.uint8)
            im = cv2.imdecode(data, cv2.IMREAD_COLOR)
            img_lst.append(im)
        imgs = self.ocr_reader.preprocess(img_lst)
        feed = {"x": imgs}
        return feed, False, None, ""

    def postprocess(self, input_dicts, fetch_dict, log_id):
        rec_res = self.ocr_reader.postprocess(fetch_dict, with_score=True)
        res_lst = []
        for res in rec_res:
            res_lst.append(res[0])
        res = {"res": str(res_lst)}
        return res, None, ""

class RecService(WebService):
    def get_pipeline_response(self, read_op):
        rec_op = RecOp(name="rec", input_ops=[read_op])
        return rec_op

service = RecService(name="rec")
service.prepare_pipeline_config("config_rec.yml")
service.run_service()

ppocr_keys_v1.txt wget https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/ppocr/utils/ppocr_keys_v1.txt

ocr_reader.py wget https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/deploy/pdserving/ocr_reader.py

TeslaZhao commented 3 years ago

您好,参考Serving v0.5版本https://github.com/PaddlePaddle/Serving/tree/v0.5.0

需要将paddle-serving-app 升级到0.3.0或0.3.1 pip install paddle-serving-app==0.3.0

zouxiaoshi commented 3 years ago

您好,参考Serving v0.5版本https://github.com/PaddlePaddle/Serving/tree/v0.5.0

需要将paddle-serving-app 升级到0.3.0或0.3.1 pip install paddle-serving-app==0.3.0

试了,还是不行。 我后来用了 generate_runtime_docker.sh 去生成相应环境,也不行。 【DEVELOP分支里的脚本】

bash tool/generate_runtime_docker.sh --env cuda10.2 --python 3.6 --serving 0.6.0 --paddle 2.0.1 

随后生成的docker镜像中,缺少paddlepaddle_gpu,看了下源码,https://github.com/PaddlePaddle/Serving/blob/a6df1730968c1107434919a236280a4cfe728b9e/tools/dockerfiles/build_scripts/install_whl.sh#L68 这个地址有问题,导致无法下载。 【构建镜像时,proxy使不了,报错,给删除了,不知道是不是proxy删除后导致的问题】

https://paddle-wheel.bj.bcebos.com/with-trt/2.0.1-gpu-cuda10.2-cudnn8-mkl-gcc8.2/paddlepaddle_gpu-2.0.1-cp36-cp36m-linux_x86_64.whl

{"code":"NoSuchKey","message":"The specified key does not exist.","requestId":"17dba6a9-3e63-46db-80a7-7700c603a24b"}

之后,通过如下方式下载paddlepaddle_gpu

python -m pip install paddlepaddle-gpu==2.0.1 -f https://paddlepaddle.org.cn/whl/stable/tensorrt.html

随后防止代码错误,跑了官方的代码 https://github.com/PaddlePaddle/PaddleOCR/tree/release/2.1/deploy/pdserving

(额外补充一点,https://github.com/PaddlePaddle/Serving/blob/a6df1730968c1107434919a236280a4cfe728b9e/python/examples/pipeline/ocr/web_service.py#L110 这行有问题,在paddleocr中已做更改
https://github.com/PaddlePaddle/PaddleOCR/blob/84445cc4732ccfb9c8e655e11f5f2961faf4074e/deploy/pdserving/web_service.py#L88 请做更新)

当client为local_predictor时

出现了内存错误,命令行中信息如下:

----------------------
Error Message Summary:
----------------------
FatalError: `Segmentation fault` is detected by the operating system.
  [TimeInfo: *** Aborted at 1623034793 (unix time) try "date -d @1623034793" if you are using GNU date ***]
  [SignalInfo: *** SIGSEGV (@0x0) received by PID 226 (TID 0x7f2e32085700) from PID 0 ***]

pipline.log 中信息如下:

INFO 2021-06-07 10:59:52,974 [pipeline_server.py:51] (log_id=0) inference request name:ocr self.name:ocr
INFO 2021-06-07 10:59:52,976 [operator.py:1375] RequestOp unpack one request. log_id:0, clientip:             name:ocr, method:prediction
INFO 2021-06-07 10:59:52,976 [dag.py:368] (data_id=0 log_id=0) Succ Generate ID 

当client为 grpc时:

发起http或 rpc 调用时,一直没发应。

目前,只有 client 为 brpc 可正常使用。

zouxiaoshi commented 3 years ago

您好,参考Serving v0.5版本https://github.com/PaddlePaddle/Serving/tree/v0.5.0

需要将paddle-serving-app 升级到0.3.0或0.3.1 pip install paddle-serving-app==0.3.0

我又试了下 https://github.com/PaddlePaddle/Serving/tree/develop/python/examples/pipeline/PaddleDetection/yolov3 这次,当client 为 brpc 和 local_predictor时,可用。 client grpc时 initialize client 会报错

grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
    status = StatusCode.UNAVAILABLE
    details = "connections to all backends failing"
    debug_error_string = "{"created":"@1623054771.577839667","description":"Failed to pick 

随后,我自己训了个yolov3 模型,然后,无论client是什么都报错。。。。[local_service_handler is None]

train_ticket_det Failed to launch local rpc service: local_service_handler is None.

现在就感觉 pipeline service 好玄学。。。

对于grpc/brpc的使用场景有些复杂了,需要启动独立的Server,并且异常信息不方便调试。对这种问题,我们再完善一下文档,再提升一下易用性。

TeslaZhao commented 3 years ago

您好,您遇到问题我来详细解答一下:

1.镜像选择: CPU: docker pull registry.baidubce.com/paddlepaddle/serving:0.6.0-devel GPU: nvidia-docker pull registry.baidubce.com/paddlepaddle/serving:0.6.0-cuda10.2-cudnn8-devel

2.安装,参考每个tag上首页的推荐的server、client、app的匹配关系安装对应版本。 在v0.6.0 版本下: pip3 install paddle-serving-client==0.6.0 pip3 install paddle-serving-server==0.6.0 # CPU pip3 install paddle-serving-app==0.6.0 pip3 install paddle-serving-server-gpu==0.6.0.post102 #GPU with CUDA10.2 + TensorRT7

CPU users, please run: pip3 install paddlepaddle==2.0.0 GPU Cuda10.2 please run: pip3 install paddlepaddle-gpu==2.0.0

3.pipeline使用 首先,推荐您使用Local predictor方式:选用local_service_conf + client_type: local_predictor,使用简单并且性能最优

根据您报的错误信息: CRITICAL 2021-05-25 08:46:08,126 [operator.py:1082] [rec|0] failed to init op: load_model_config() got an unexpected keyword argument 'use_lite' use_lite是在v0.6.0加入的特性,需要将pip3 install的版本都升级到最新(2.安装)版本,这样的话OCR示例可以运行的。

TeslaZhao commented 3 years ago

您好,参考Serving v0.5版本https://github.com/PaddlePaddle/Serving/tree/v0.5.0 需要将paddle-serving-app 升级到0.3.0或0.3.1 pip install paddle-serving-app==0.3.0

试了,还是不行。 我后来用了 generate_runtime_docker.sh 去生成相应环境,也不行。 【DEVELOP分支里的脚本】

bash tool/generate_runtime_docker.sh --env cuda10.2 --python 3.6 --serving 0.6.0 --paddle 2.0.1 

随后生成的docker镜像中,缺少paddlepaddle_gpu,看了下源码,

https://github.com/PaddlePaddle/Serving/blob/a6df1730968c1107434919a236280a4cfe728b9e/tools/dockerfiles/build_scripts/install_whl.sh#L68

这个地址有问题,导致无法下载。 【构建镜像时,proxy使不了,报错,给删除了,不知道是不是proxy删除后导致的问题】

https://paddle-wheel.bj.bcebos.com/with-trt/2.0.1-gpu-cuda10.2-cudnn8-mkl-gcc8.2/paddlepaddle_gpu-2.0.1-cp36-cp36m-linux_x86_64.whl

{"code":"NoSuchKey","message":"The specified key does not exist.","requestId":"17dba6a9-3e63-46db-80a7-7700c603a24b"}

之后,通过如下方式下载paddlepaddle_gpu

python -m pip install paddlepaddle-gpu==2.0.1 -f https://paddlepaddle.org.cn/whl/stable/tensorrt.html

随后防止代码错误,跑了官方的代码 https://github.com/PaddlePaddle/PaddleOCR/tree/release/2.1/deploy/pdserving

(额外补充一点,

https://github.com/PaddlePaddle/Serving/blob/a6df1730968c1107434919a236280a4cfe728b9e/python/examples/pipeline/ocr/web_service.py#L110

这行有问题,在paddleocr中已做更改 https://github.com/PaddlePaddle/PaddleOCR/blob/84445cc4732ccfb9c8e655e11f5f2961faf4074e/deploy/pdserving/web_service.py#L88 请做更新)

当client为local_predictor时

出现了内存错误,命令行中信息如下:

----------------------
Error Message Summary:
----------------------
FatalError: `Segmentation fault` is detected by the operating system.
  [TimeInfo: *** Aborted at 1623034793 (unix time) try "date -d @1623034793" if you are using GNU date ***]
  [SignalInfo: *** SIGSEGV (@0x0) received by PID 226 (TID 0x7f2e32085700) from PID 0 ***]

pipline.log 中信息如下:

INFO 2021-06-07 10:59:52,974 [pipeline_server.py:51] (log_id=0) inference request name:ocr self.name:ocr
INFO 2021-06-07 10:59:52,976 [operator.py:1375] RequestOp unpack one request. log_id:0, clientip:             name:ocr, method:prediction
INFO 2021-06-07 10:59:52,976 [dag.py:368] (data_id=0 log_id=0) Succ Generate ID 

当client为 grpc时:

发起http或 rpc 调用时,一直没发应。

目前,只有 client 为 brpc 可正常使用。

对于OCR示例中max_batch_size设置和OCR repo里不同,其实2种情况都经过测试的,是针对shape维度很大图片的特定优化(max_batch_size = 6),在图片偏小的场景max_batch_size = len(dt_boxes)效果更好 max_batch_size = 6 # len(dt_boxes) https://github.com/PaddlePaddle/PaddleOCR/blob/84445cc4732ccfb9c8e655e11f5f2961faf4074e/deploy/pdserving/web_service.py#L88