diff --git a/ppocr/modeling/backbones/rec_resnetv2.py b/ppocr/modeling/backbones/rec_resnetv2.py index 083e08c7b98..0f58646b77b 100644 --- a/ppocr/modeling/backbones/rec_resnetv2.py +++ b/ppocr/modeling/backbones/rec_resnetv2.py @@ -630,9 +630,7 @@ def __init__( self.act = nn.Identity() def forward(self, x): - x = group_norm( - x, self._num_groups, self._epsilon, weight=self.weight, bias=self.bias - ) + x = paddle.nn.functional.group_norm(x, num_groups=self._num_groups, weight=self.weight, bias=self.bias) x = self.act(x) return x diff --git a/ppocr/modeling/heads/rec_latexocr_head.py b/ppocr/modeling/heads/rec_latexocr_head.py index 4e368da0dd4..1484f87b120 100644 --- a/ppocr/modeling/heads/rec_latexocr_head.py +++ b/ppocr/modeling/heads/rec_latexocr_head.py @@ -977,10 +977,7 @@ def generate_export( paddle.cumsum((out == eos_token).cast(paddle.int64), 1)[:, -1] >= 1 ).all() ): - out = out[:, t:] - if num_dims == 1: - out = out.squeeze(0) - return out + break i_idx += 1 out = out[:, t:] if num_dims == 1: