提交 88b0a379 编写于 作者: M MRXLT

add memory optimize for cpu server

上级 78213f94
......@@ -38,6 +38,8 @@ def parse_args(): # pylint: disable=doc-string-missing
help="Working dir of current service")
parser.add_argument(
"--device", type=str, default="cpu", help="Type of device")
parser.add_argument(
"--mem_optim", type=bool, default=False, help="Memory optimize")
return parser.parse_args()
......@@ -48,6 +50,7 @@ def start_standard_model(): # pylint: disable=doc-string-missing
port = args.port
workdir = args.workdir
device = args.device
mem_optim = args.mem_optim
if model == "":
print("You must specify your serving model")
......@@ -67,6 +70,7 @@ def start_standard_model(): # pylint: disable=doc-string-missing
server = serving.Server()
server.set_op_sequence(op_seq_maker.get_op_sequence())
server.set_num_threads(thread_num)
server.set_memory_optimize(mem_optim)
server.load_model_config(model)
server.prepare_server(workdir=workdir, port=port, device=device)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册