From acffd750f7ad93cf545e761e95b090384345aac2 Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Thu, 11 Mar 2021 15:30:33 +0800 Subject: [PATCH] fix attn export --- ppocr/modeling/heads/rec_att_head.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppocr/modeling/heads/rec_att_head.py b/ppocr/modeling/heads/rec_att_head.py index 0d222714..4286d769 100644 --- a/ppocr/modeling/heads/rec_att_head.py +++ b/ppocr/modeling/heads/rec_att_head.py @@ -38,7 +38,7 @@ class AttentionHead(nn.Layer): return input_ont_hot def forward(self, inputs, targets=None, batch_max_length=25): - batch_size = inputs.shape[0] + batch_size = paddle.shape(inputs)[0] num_steps = batch_max_length hidden = paddle.zeros((batch_size, self.hidden_size)) -- GitLab