From 5b1d98af5185362002d591d2babba41fcfe101ef Mon Sep 17 00:00:00 2001 From: heya02 Date: Fri, 3 Jul 2020 10:44:28 +0000 Subject: [PATCH] fix test_client.py for py3 --- python/examples/criteo_ctr_with_cube/test_client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/examples/criteo_ctr_with_cube/test_client.py b/python/examples/criteo_ctr_with_cube/test_client.py index ca752b76..8518db55 100755 --- a/python/examples/criteo_ctr_with_cube/test_client.py +++ b/python/examples/criteo_ctr_with_cube/test_client.py @@ -20,6 +20,8 @@ import criteo as criteo import time from paddle_serving_client.metric import auc +py_version = sys.version_info[0] + client = Client() client.load_client_config(sys.argv[1]) client.connect(["127.0.0.1:9292"]) @@ -34,7 +36,10 @@ label_list = [] prob_list = [] start = time.time() for ei in range(10000): - data = reader().next() + if py_version == 2: + data = reader().next() + else: + data = reader().__next__() feed_dict = {} feed_dict['dense_input'] = data[0][0] for i in range(1, 27): -- GitLab