From a3a74e8f8efb2fc13762590f1b4ed2bf3e10f909 Mon Sep 17 00:00:00 2001 From: barrierye Date: Sun, 21 Jun 2020 23:27:46 +0800 Subject: [PATCH] warm up in cube test example --- python/examples/criteo_ctr_with_cube/test_client.py | 3 +-- .../grpc_impl_example/criteo_ctr_with_cube/test_client.py | 1 + tools/serving_build.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/examples/criteo_ctr_with_cube/test_client.py b/python/examples/criteo_ctr_with_cube/test_client.py index ac1a5f68..ca752b76 100755 --- a/python/examples/criteo_ctr_with_cube/test_client.py +++ b/python/examples/criteo_ctr_with_cube/test_client.py @@ -42,8 +42,7 @@ for ei in range(10000): fetch_map = client.predict(feed=feed_dict, fetch=["prob"]) prob_list.append(fetch_map['prob'][0][1]) label_list.append(data[0][-1][0]) - break -print(prob_list) + print(auc(label_list, prob_list)) end = time.time() print(end - start) diff --git a/python/examples/grpc_impl_example/criteo_ctr_with_cube/test_client.py b/python/examples/grpc_impl_example/criteo_ctr_with_cube/test_client.py index ffece54c..fe26e3d9 100755 --- a/python/examples/grpc_impl_example/criteo_ctr_with_cube/test_client.py +++ b/python/examples/grpc_impl_example/criteo_ctr_with_cube/test_client.py @@ -19,6 +19,7 @@ import os import criteo as criteo import time from paddle_serving_client.metric import auc +import grpc client = Client() client.connect(["127.0.0.1:9292"]) diff --git a/tools/serving_build.sh b/tools/serving_build.sh index ae4f5b83..47fbb2b5 100644 --- a/tools/serving_build.sh +++ b/tools/serving_build.sh @@ -550,8 +550,6 @@ function python_test_grpc_impl() { check_cmd "mkdir work_dir1 && cp cube/conf/cube.conf ./work_dir1/" python test_server.py ctr_serving_model_kv ctr_client_conf/serving_client_conf.prototxt & sleep 5 - # for warm up - python test_client.py ./ut_data &> /dev/null || true check_cmd "python test_client.py ./ut_data >score" tail -n 2 score | awk 'NR==1' AUC=$(tail -n 2 score | awk 'NR==1') @@ -610,6 +608,8 @@ function python_test_grpc_impl() { check_cmd "mkdir work_dir1 && cp cube/conf/cube.conf ./work_dir1/" python test_server_gpu.py ctr_serving_model_kv ctr_client_conf/serving_client_conf.prototxt & sleep 5 + # for warm up + python test_client.py ./ut_data &> /dev/null || true check_cmd "python test_client.py ./ut_data >score" tail -n 2 score | awk 'NR==1' AUC=$(tail -n 2 score | awk 'NR==1') -- GitLab