From 8fd3d3964e5763b9f515bdfdb6fec79e10909257 Mon Sep 17 00:00:00 2001 From: MRXLT Date: Tue, 9 Jun 2020 07:00:16 +0000 Subject: [PATCH] fix mem_optim ir_optim use_mkl arguments --- README.md | 6 +++--- README_CN.md | 6 +++--- doc/BERT_10_MINS.md | 2 +- doc/BERT_10_MINS_CN.md | 2 +- python/paddle_serving_server/serve.py | 10 +++++++--- python/paddle_serving_server_gpu/__init__.py | 7 +++++-- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index f209e58b..e7d9fa03 100644 --- a/README.md +++ b/README.md @@ -111,9 +111,9 @@ python -m paddle_serving_server.serve --model uci_housing_model --thread 10 --po | `port` | int | `9292` | Exposed port of current service to users| | `name` | str | `""` | Service name, can be used to generate HTTP request url | | `model` | str | `""` | Path of paddle model directory to be served | -| `mem_optim` | bool | `False` | Enable memory / graphic memory optimization | -| `ir_optim` | bool | `False` | Enable analysis and optimization of calculation graph | -| `use_mkl` (Only for cpu version) | bool | `False` | Run inference with MKL | +| `mem_optim` | - | - | Enable memory / graphic memory optimization | +| `ir_optim` | - | - | Enable analysis and optimization of calculation graph | +| `use_mkl` (Only for cpu version) | - | - | Run inference with MKL | Here, we use `curl` to send a HTTP POST request to the service we just started. Users can use any python library to send HTTP POST as well, e.g, [requests](https://requests.readthedocs.io/en/master/). diff --git a/README_CN.md b/README_CN.md index 05d3ad21..3eeb5c2b 100644 --- a/README_CN.md +++ b/README_CN.md @@ -115,9 +115,9 @@ python -m paddle_serving_server.serve --model uci_housing_model --thread 10 --po | `port` | int | `9292` | Exposed port of current service to users| | `name` | str | `""` | Service name, can be used to generate HTTP request url | | `model` | str | `""` | Path of paddle model directory to be served | -| `mem_optim` | bool | `False` | Enable memory optimization | -| `ir_optim` | bool | `False` | Enable analysis and optimization of calculation graph | -| `use_mkl` (Only for cpu version) | bool | `False` | Run inference with MKL | +| `mem_optim` | - | - | Enable memory optimization | +| `ir_optim` | - | - | Enable analysis and optimization of calculation graph | +| `use_mkl` (Only for cpu version) | - | - | Run inference with MKL | 我们使用 `curl` 命令来发送HTTP POST请求给刚刚启动的服务。用户也可以调用python库来发送HTTP POST请求,请参考英文文档 [requests](https://requests.readthedocs.io/en/master/)。 diff --git a/doc/BERT_10_MINS.md b/doc/BERT_10_MINS.md index 71f6f065..53e51768 100644 --- a/doc/BERT_10_MINS.md +++ b/doc/BERT_10_MINS.md @@ -59,7 +59,7 @@ the script of client side bert_client.py is as follow: import os import sys from paddle_serving_client import Client -from paddle_serving_app import ChineseBertReader +from paddle_serving_app.reader import ChineseBertReader reader = ChineseBertReader() fetch = ["pooled_output"] diff --git a/doc/BERT_10_MINS_CN.md b/doc/BERT_10_MINS_CN.md index b7a5180d..e4904d86 100644 --- a/doc/BERT_10_MINS_CN.md +++ b/doc/BERT_10_MINS_CN.md @@ -52,7 +52,7 @@ pip install paddle_serving_app ``` python import sys from paddle_serving_client import Client -from paddle_serving_app import ChineseBertReader +from paddle_serving_app.reader import ChineseBertReader reader = ChineseBertReader() fetch = ["pooled_output"] diff --git a/python/paddle_serving_server/serve.py b/python/paddle_serving_server/serve.py index 894b0c5b..e75240df 100644 --- a/python/paddle_serving_server/serve.py +++ b/python/paddle_serving_server/serve.py @@ -40,10 +40,14 @@ def parse_args(): # pylint: disable=doc-string-missing parser.add_argument( "--device", type=str, default="cpu", help="Type of device") parser.add_argument( - "--mem_optim", type=bool, default=False, help="Memory optimize") + "--mem_optim", + default=False, + action="store_true", + help="Memory optimize") parser.add_argument( - "--ir_optim", type=bool, default=False, help="Graph optimize") - parser.add_argument("--use_mkl", type=bool, default=False, help="Use MKL") + "--ir_optim", default=False, action="store_true", help="Graph optimize") + parser.add_argument( + "--use_mkl", default=False, action="store_true", help="Use MKL") parser.add_argument( "--max_body_size", type=int, diff --git a/python/paddle_serving_server_gpu/__init__.py b/python/paddle_serving_server_gpu/__init__.py index e40c0fa4..ace49055 100644 --- a/python/paddle_serving_server_gpu/__init__.py +++ b/python/paddle_serving_server_gpu/__init__.py @@ -47,9 +47,12 @@ def serve_args(): parser.add_argument( "--name", type=str, default="None", help="Default service name") parser.add_argument( - "--mem_optim", type=bool, default=False, help="Memory optimize") + "--mem_optim", + default=False, + action="store_true", + help="Memory optimize") parser.add_argument( - "--ir_optim", type=bool, default=False, help="Graph optimize") + "--ir_optim", default=False, action="store_true", help="Graph optimize") parser.add_argument( "--max_body_size", type=int, -- GitLab