From cf4a41542b70ceb0768ed9286167e99b407fa953 Mon Sep 17 00:00:00 2001 From: zhoujun Date: Mon, 30 Nov 2020 11:38:27 -0600 Subject: [PATCH] fix image_shape error when tps in model and char_type is ch (#1290) --- ppocr/modeling/architectures/rec_model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ppocr/modeling/architectures/rec_model.py b/ppocr/modeling/architectures/rec_model.py index 9f8c779c..8bc5cb0e 100755 --- a/ppocr/modeling/architectures/rec_model.py +++ b/ppocr/modeling/architectures/rec_model.py @@ -160,6 +160,7 @@ class RecModel(object): "We set img_shape to be the same , it may affect the inference effect" ) image_shape = deepcopy(self.image_shape) + image_shape.insert(0, -1) image = fluid.data(name='image', shape=image_shape, dtype='float32') image.stop_gradient = False if self.loss_type == "srn": -- GitLab