From c958028f1c95bc969b7af0e55debde2604b2cd56 Mon Sep 17 00:00:00 2001 From: MRXLT Date: Fri, 27 Mar 2020 19:30:13 +0800 Subject: [PATCH] change batch_predict to predict --- python/examples/bert/benchmark_batch.py | 3 +-- python/examples/criteo_ctr/benchmark_batch.py | 3 +-- python/examples/imagenet/benchmark_batch.py | 3 +-- python/examples/imdb/benchmark_batch.py | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/python/examples/bert/benchmark_batch.py b/python/examples/bert/benchmark_batch.py index 872799e6..265521d4 100644 --- a/python/examples/bert/benchmark_batch.py +++ b/python/examples/bert/benchmark_batch.py @@ -57,8 +57,7 @@ def single_func(idx, resource): os.getpid(), int(round(b_start * 1000000)), int(round(b_end * 1000000)))) - result = client.batch_predict( - feed_batch=feed_batch, fetch=fetch) + result = client.predict(feed_batch=feed_batch, fetch=fetch) else: print("unsupport batch size {}".format(args.batch_size)) diff --git a/python/examples/criteo_ctr/benchmark_batch.py b/python/examples/criteo_ctr/benchmark_batch.py index 47b63a6a..ab675073 100644 --- a/python/examples/criteo_ctr/benchmark_batch.py +++ b/python/examples/criteo_ctr/benchmark_batch.py @@ -55,8 +55,7 @@ def single_func(idx, resource): for i in range(1, 27): feed_dict["sparse_{}".format(i - 1)] = data[0][i] feed_batch.append(feed_dict) - result = client.batch_predict( - feed_batch=feed_batch, fetch=fetch) + result = client.predict(feed_batch=feed_batch, fetch=fetch) else: print("unsupport batch size {}".format(args.batch_size)) diff --git a/python/examples/imagenet/benchmark_batch.py b/python/examples/imagenet/benchmark_batch.py index 74771009..915544d4 100644 --- a/python/examples/imagenet/benchmark_batch.py +++ b/python/examples/imagenet/benchmark_batch.py @@ -50,8 +50,7 @@ def single_func(idx, resource): img = reader.process_image(img_list[i]) img = img.reshape(-1) feed_batch.append({"image": img}) - result = client.batch_predict( - feed_batch=feed_batch, fetch=fetch) + result = client.predict(feed_batch=feed_batch, fetch=fetch) else: print("unsupport batch size {}".format(args.batch_size)) diff --git a/python/examples/imdb/benchmark_batch.py b/python/examples/imdb/benchmark_batch.py index 302d6335..3ac52ec5 100644 --- a/python/examples/imdb/benchmark_batch.py +++ b/python/examples/imdb/benchmark_batch.py @@ -42,7 +42,7 @@ def single_func(idx, resource): for bi in range(args.batch_size): word_ids, label = imdb_dataset.get_words_and_label(line) feed_batch.append({"words": word_ids}) - result = client.batch_predict( + result = client.predict( feed_batch=feed_batch, fetch=["prediction"]) else: print("unsupport batch size {}".format(args.batch_size)) -- GitLab