diff --git a/ppocr/modeling/heads/rec_ctc_head.py b/ppocr/modeling/heads/rec_ctc_head.py index 5cc4f9d8a4cf8da71e114d70890d6951345658ed..6c1cf0659607186d54dfee6983b135f34d542446 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 de771acca86a8956b06b366b840aac7e21f835a4..0ffe917b0eb519cb0dc15efd69ccb40962a308b8 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 cfe0947fe010f1545288e3e55922f980e89980d2..98c125229d7f968cd3f650c3885ba4edb0de754c 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