From efaf551805dd57634cf59f439e0d413855eef558 Mon Sep 17 00:00:00 2001 From: cnn Date: Fri, 30 Jul 2021 21:52:54 +0800 Subject: [PATCH] update serving (#3801) (#3816) --- deploy/serving/README.md | 4 ++-- deploy/serving/test_client.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/deploy/serving/README.md b/deploy/serving/README.md index 5da6942385c30..402d779224a7a 100644 --- a/deploy/serving/README.md +++ b/deploy/serving/README.md @@ -10,7 +10,7 @@ python tools/infer.py -c configs/yolov3/yolov3_darknet53_270e_coco.yml --infer_i ``` ## 2. 安装 paddle serving -请参考[PaddleServing](https://github.com/PaddlePaddle/Serving/tree/v0.5.0) 中安装教程安装 +请参考[PaddleServing](https://github.com/PaddlePaddle/Serving/tree/v0.6.0) 中安装教程安装(版本>=0.6.0)。 ## 3. 导出模型 PaddleDetection在训练过程包括网络的前向和优化器相关参数,而在部署过程中,我们只需要前向参数,具体参考:[导出模型](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/deploy/EXPORT_MODEL.md) @@ -87,7 +87,7 @@ fetch_var { cd output_inference/yolov3_darknet53_270e_coco/ # GPU -python -m paddle_serving_server_gpu.serve --model serving_server --port 9393 --gpu_ids 0 +python -m paddle_serving_server.serve --model serving_server --port 9393 --gpu_ids 0 # CPU python -m paddle_serving_server.serve --model serving_server --port 9393 diff --git a/deploy/serving/test_client.py b/deploy/serving/test_client.py index 7c2a6395f1ef3..b6a688e22a5ff 100644 --- a/deploy/serving/test_client.py +++ b/deploy/serving/test_client.py @@ -33,8 +33,12 @@ fetch_map = client.predict( feed={ "image": im, - "im_size": np.array(list(im.shape[1:])), + "im_shape": np.array(list(im.shape[1:])).reshape(-1), + "scale_factor": np.array([1.0, 1.0]).reshape(-1), }, - fetch=["multiclass_nms_0.tmp_0"]) + fetch=["save_infer_model/scale_0.tmp_1"], + batch=False) +print(fetch_map) fetch_map["image"] = sys.argv[1] postprocess(fetch_map) +