From 79e83a8d6ceee8be3cbad3aa848f954bcdcca6bf Mon Sep 17 00:00:00 2001 From: MissPenguin Date: Tue, 22 Jun 2021 08:14:07 +0000 Subject: [PATCH] refine --- ppocr/modeling/heads/rec_ctc_head.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ppocr/modeling/heads/rec_ctc_head.py b/ppocr/modeling/heads/rec_ctc_head.py index 86e81677..03bc3daa 100755 --- a/ppocr/modeling/heads/rec_ctc_head.py +++ b/ppocr/modeling/heads/rec_ctc_head.py @@ -45,7 +45,12 @@ class CTCHead(nn.Layer): self.out_channels = out_channels def forward(self, x, targets=None): - predicts = self.fc(x) + if self.mid_channels is None: + predicts = self.fc(x) + else: + predicts = self.fc1(x) + predicts = self.fc2(predicts) + if not self.training: predicts = F.softmax(predicts, axis=2) return predicts -- GitLab