From 3b2810d32244e0e6c8a2d54f527491b92c80a1de Mon Sep 17 00:00:00 2001 From: MRXLT Date: Mon, 18 May 2020 20:30:10 +0800 Subject: [PATCH] local_predict support list --- python/paddle_serving_app/local_predict.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/paddle_serving_app/local_predict.py b/python/paddle_serving_app/local_predict.py index 66209941..93039c6f 100644 --- a/python/paddle_serving_app/local_predict.py +++ b/python/paddle_serving_app/local_predict.py @@ -115,6 +115,13 @@ class Debugger(object): inputs = [] for name in self.feed_names_: + if isinstance(feed[name], list): + feed[name] = np.array(feed[name]).reshape(self.feed_shapes_[ + name]) + if self.feed_types_[name] == 0: + feed[name] = feed[name].astype("int64") + else: + feed[name] = feed[name].astype("float32") inputs.append(PaddleTensor(feed[name][np.newaxis, :])) outputs = self.predictor.run(inputs) -- GitLab