From 09de9e4d54f76740206fdaba3957bcd8b731d872 Mon Sep 17 00:00:00 2001 From: zhoujun <572459439@qq.com> Date: Tue, 29 Nov 2022 10:16:32 +0800 Subject: [PATCH] fix re error (#5686) --- paddlecv/ppcv/ops/models/ocr/ocr_kie/preprocess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddlecv/ppcv/ops/models/ocr/ocr_kie/preprocess.py b/paddlecv/ppcv/ops/models/ocr/ocr_kie/preprocess.py index 09897b09..ba4d4a7d 100644 --- a/paddlecv/ppcv/ops/models/ocr/ocr_kie/preprocess.py +++ b/paddlecv/ppcv/ops/models/ocr/ocr_kie/preprocess.py @@ -566,7 +566,7 @@ class ReInput(object): end.append(entity['end']) label.append(self.entities_labels[pred]) - entities = np.full([max_seq_len + 1, 3], fill_value=-1) + entities = np.full([max_seq_len + 1, 3], fill_value=-1, dtype=np.int64) entities[0, 0] = len(start) entities[1:len(start) + 1, 0] = start entities[0, 1] = len(end) @@ -583,7 +583,7 @@ class ReInput(object): head.append(i) tail.append(j) - relations = np.full([len(head) + 1, 2], fill_value=-1) + relations = np.full([len(head) + 1, 2], fill_value=-1, dtype=np.int64) relations[0, 0] = len(head) relations[1:len(head) + 1, 0] = head relations[0, 1] = len(tail) -- GitLab