From 1f683210f9b85dc87b98fd48efddeb03bc9d74c9 Mon Sep 17 00:00:00 2001 From: WangXi Date: Fri, 24 Apr 2020 17:29:29 +0800 Subject: [PATCH] fix result numpy dtype --- python/paddle_serving_client/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/paddle_serving_client/__init__.py b/python/paddle_serving_client/__init__.py index 8aeb22c9..053062ee 100644 --- a/python/paddle_serving_client/__init__.py +++ b/python/paddle_serving_client/__init__.py @@ -273,7 +273,7 @@ class Client(object): if self.fetch_names_to_type_[name] == int_type: result_map[name] = result_batch.get_int64_by_name(mi, name) shape = result_batch.get_shape(mi, name) - result_map[name] = np.array(result_map[name]) + result_map[name] = np.array(result_map[name], dtype='int64') result_map[name].shape = shape if name in self.lod_tensor_set: result_map["{}.lod".format( @@ -281,7 +281,8 @@ class Client(object): elif self.fetch_names_to_type_[name] == float_type: result_map[name] = result_batch.get_float_by_name(mi, name) shape = result_batch.get_shape(mi, name) - result_map[name] = np.array(result_map[name]) + result_map[name] = np.array( + result_map[name], dtype='float32') result_map[name].shape = shape if name in self.lod_tensor_set: result_map["{}.lod".format( -- GitLab