From 154f42f1b07f273fd2ebb550c7074934c81d16e8 Mon Sep 17 00:00:00 2001 From: zhiminzhang0830 <452516515@qq.com> Date: Wed, 28 Sep 2022 17:44:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E7=90=86=E6=97=B6=E6=B7=BB=E5=8A=A0so?= =?UTF-8?q?ftmax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ppocr/modeling/heads/rec_att_head.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ppocr/modeling/heads/rec_att_head.py b/ppocr/modeling/heads/rec_att_head.py index d5cf1cd1..6349ee0c 100644 --- a/ppocr/modeling/heads/rec_att_head.py +++ b/ppocr/modeling/heads/rec_att_head.py @@ -169,7 +169,8 @@ class AttentionLSTM(nn.Layer): next_input = probs_step.argmax(axis=1) targets = next_input - + if not self.training: + probs = paddle.nn.functional.softmax(probs, axis=2) return probs -- GitLab