From a8c8f485cb82efc9235438f3e66c80ddffb0dd6a Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Thu, 7 Apr 2022 08:30:17 +0000 Subject: [PATCH] delete debug --- ppocr/modeling/heads/rec_ctc_head.py | 2 -- ppocr/postprocess/rec_postprocess.py | 3 ++- test_tipc/configs/ch_PP-OCRv2_rec_PACT/train_infer_python.txt | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ppocr/modeling/heads/rec_ctc_head.py b/ppocr/modeling/heads/rec_ctc_head.py index 5cc4f9d8..6c1cf065 100755 --- a/ppocr/modeling/heads/rec_ctc_head.py +++ b/ppocr/modeling/heads/rec_ctc_head.py @@ -80,9 +80,7 @@ class CTCHead(nn.Layer): result = (x, predicts) else: result = predicts - print("self.training: ", self.training) if not self.training: - print("self.training, ", self.training) predicts = F.softmax(predicts, axis=2) result = predicts diff --git a/ppocr/postprocess/rec_postprocess.py b/ppocr/postprocess/rec_postprocess.py index de771acc..0ffe917b 100644 --- a/ppocr/postprocess/rec_postprocess.py +++ b/ppocr/postprocess/rec_postprocess.py @@ -89,10 +89,11 @@ class CTCLabelDecode(BaseRecLabelDecode): use_space_char) def __call__(self, preds, label=None, *args, **kwargs): - if isinstance(preds, tuple): + if isinstance(preds, tuple) or isinstance(preds, list): preds = preds[-1] if isinstance(preds, paddle.Tensor): preds = preds.numpy() + print(preds.shape) preds_idx = preds.argmax(axis=2) preds_prob = preds.max(axis=2) text = self.decode(preds_idx, preds_prob, is_remove_duplicate=True) diff --git a/test_tipc/configs/ch_PP-OCRv2_rec_PACT/train_infer_python.txt b/test_tipc/configs/ch_PP-OCRv2_rec_PACT/train_infer_python.txt index cfe0947f..98c12522 100644 --- a/test_tipc/configs/ch_PP-OCRv2_rec_PACT/train_infer_python.txt +++ b/test_tipc/configs/ch_PP-OCRv2_rec_PACT/train_infer_python.txt @@ -1,7 +1,7 @@ ===========================train_params=========================== model_name:ch_PPOCRv2_rec_PACT python:python3.7 -gpu_list:6 +gpu_list:0|0,1 Global.use_gpu:True|True Global.auto_cast:fp32 Global.epoch_num:lite_train_lite_infer=6|whole_train_whole_infer=300 -- GitLab