Fix att loss
diff --git a/ppocr/modeling/heads/rec_att_head.py b/ppocr/modeling/heads/rec_att_head.py
index 6d77e42eb5..ab8b119fe0 100644
--- a/ppocr/modeling/heads/rec_att_head.py
+++ b/ppocr/modeling/heads/rec_att_head.py
@@ -53,7 +53,6 @@ def forward(self, inputs, targets=None, batch_max_length=25):
                 output_hiddens.append(paddle.unsqueeze(outputs, axis=1))
             output = paddle.concat(output_hiddens, axis=1)
             probs = self.generator(output)
-
         else:
             targets = paddle.zeros(shape=[batch_size], dtype="int32")
             probs = None
@@ -75,6 +74,7 @@ def forward(self, inputs, targets=None, batch_max_length=25):
                             probs_step, axis=1)], axis=1)
                 next_input = probs_step.argmax(axis=1)
                 targets = next_input
+        if not self.training:
             probs = paddle.nn.functional.softmax(probs, axis=2)
         return probs
 

att