diff --git a/python/examples/criteo_ctr_with_cube/benchmark.py b/python/examples/criteo_ctr_with_cube/benchmark.py index a850d244b0a5a1a01e98a6207fa9674b6ea0af1a..12abbc9cd3777daf4ebb0b14aaa4cba6aceed875 100755 --- a/python/examples/criteo_ctr_with_cube/benchmark.py +++ b/python/examples/criteo_ctr_with_cube/benchmark.py @@ -24,6 +24,7 @@ from paddle_serving_client.utils import MultiThreadRunner from paddle_serving_client.utils import benchmark_args from paddle_serving_client.metric import auc +py_version = sys.version_info[0] args = benchmark_args() @@ -49,7 +50,10 @@ def single_func(idx, resource): if args.batch_size > 0: feed_batch = [] for bi in range(args.batch_size): - 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):