From f00e91f72d24b5c75d8ced3e5eb2b13a8626a7a9 Mon Sep 17 00:00:00 2001 From: ShiningZhang Date: Mon, 6 Sep 2021 20:32:25 +0800 Subject: [PATCH] fix client.py: check if the feed of string_type is np.array --- python/paddle_serving_client/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/paddle_serving_client/client.py b/python/paddle_serving_client/client.py index eada4b8d..826a2edb 100755 --- a/python/paddle_serving_client/client.py +++ b/python/paddle_serving_client/client.py @@ -417,7 +417,10 @@ class Client(object): key)]) else: string_lod_slot_batch.append([]) - string_slot.append(feed_dict[key].tostring()) + if type(feed_dict[key]) is np.ndarray: + string_slot.append(feed_dict[key].tostring()) + else: + string_slot.append(feed_dict[key]) self.has_numpy_input = True self.profile_.record('py_prepro_1') -- GitLab