diff --git a/ppocr/modeling/heads/rec_abinet_head.py b/ppocr/modeling/heads/rec_abinet_head.py index a0f60f1be1727e85380eedb7d311ce9445f88b8e..29450288c0c9bf70d41b172b27cd0ccb9b7b88c3 100644 --- a/ppocr/modeling/heads/rec_abinet_head.py +++ b/ppocr/modeling/heads/rec_abinet_head.py @@ -273,7 +273,7 @@ def _get_length(logit): out = out.cast('int32') out = out.argmax(-1) out = out + 1 - out = paddle.where(abn, out, paddle.to_tensor(logit.shape[1])) + out = paddle.where(abn, out, paddle.full_like(out, logit.shape[1])) return out