From b2dbbc3ca40f06c5d53277957e9fbc425579e35a Mon Sep 17 00:00:00 2001 From: lubin10 Date: Fri, 21 Jan 2022 05:45:21 +0000 Subject: [PATCH] fix predict_det.py error --- deploy/python/predict_det.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/deploy/python/predict_det.py b/deploy/python/predict_det.py index 7b23e622..e4e0a24a 100644 --- a/deploy/python/predict_det.py +++ b/deploy/python/predict_det.py @@ -109,17 +109,16 @@ class DetPredictor(Predictor): ''' inputs = self.preprocess(image) np_boxes = None - input_names = self.paddle_predictor.get_input_names() + input_names = self.predictor.get_input_names() for i in range(len(input_names)): - input_tensor = self.paddle_predictor.get_input_handle(input_names[ - i]) + input_tensor = self.predictor.get_input_handle(input_names[i]) input_tensor.copy_from_cpu(inputs[input_names[i]]) t1 = time.time() - self.paddle_predictor.run() - output_names = self.paddle_predictor.get_output_names() - boxes_tensor = self.paddle_predictor.get_output_handle(output_names[0]) + self.predictor.run() + output_names = self.predictor.get_output_names() + boxes_tensor = self.predictor.get_output_handle(output_names[0]) np_boxes = boxes_tensor.copy_to_cpu() t2 = time.time() -- GitLab