From bb7a3b0e9a039dafc80e740b9c535e8e20ecdad1 Mon Sep 17 00:00:00 2001 From: Topdu <784990967@qq.com> Date: Wed, 20 Jul 2022 08:57:55 +0000 Subject: [PATCH] fix win&mac bug of abinet | validation --- configs/rec/rec_mtb_nrtr.yml | 2 +- configs/rec/rec_r45_abinet.yml | 2 +- configs/rec/rec_svtrnet.yml | 4 ++-- configs/rec/rec_vitstr_none_ce.yml | 2 +- ppocr/modeling/heads/rec_abinet_head.py | 3 ++- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/configs/rec/rec_mtb_nrtr.yml b/configs/rec/rec_mtb_nrtr.yml index 4e5826ad..eacde296 100644 --- a/configs/rec/rec_mtb_nrtr.yml +++ b/configs/rec/rec_mtb_nrtr.yml @@ -82,7 +82,7 @@ Train: Eval: dataset: name: LMDBDataSet - data_dir: ./train_data/data_lmdb_release/validation/ + data_dir: ./train_data/data_lmdb_release/evaluaiton/ transforms: - DecodeImage: # load image img_mode: BGR diff --git a/configs/rec/rec_r45_abinet.yml b/configs/rec/rec_r45_abinet.yml index e604bcd1..3c5e5122 100644 --- a/configs/rec/rec_r45_abinet.yml +++ b/configs/rec/rec_r45_abinet.yml @@ -82,7 +82,7 @@ Train: Eval: dataset: name: LMDBDataSet - data_dir: ./train_data/data_lmdb_release/validation/ + data_dir: ./train_data/data_lmdb_release/evaluation/ transforms: - DecodeImage: # load image img_mode: RGB diff --git a/configs/rec/rec_svtrnet.yml b/configs/rec/rec_svtrnet.yml index c1f5cc38..e8ceefea 100644 --- a/configs/rec/rec_svtrnet.yml +++ b/configs/rec/rec_svtrnet.yml @@ -77,7 +77,7 @@ Metric: Train: dataset: name: LMDBDataSet - data_dir: ./train_data/data_lmdb_release/training + data_dir: ./train_data/data_lmdb_release/training/ transforms: - DecodeImage: # load image img_mode: BGR @@ -97,7 +97,7 @@ Train: Eval: dataset: name: LMDBDataSet - data_dir: ./train_data/data_lmdb_release/validation + data_dir: ./train_data/data_lmdb_release/evaluation/ transforms: - DecodeImage: # load image img_mode: BGR diff --git a/configs/rec/rec_vitstr_none_ce.yml b/configs/rec/rec_vitstr_none_ce.yml index b969c83a..13a7d7d1 100644 --- a/configs/rec/rec_vitstr_none_ce.yml +++ b/configs/rec/rec_vitstr_none_ce.yml @@ -81,7 +81,7 @@ Train: Eval: dataset: name: LMDBDataSet - data_dir: ./train_data/data_lmdb_release/validation/ + data_dir: ./train_data/data_lmdb_release/evaluaiton/ transforms: - DecodeImage: # load image img_mode: BGR diff --git a/ppocr/modeling/heads/rec_abinet_head.py b/ppocr/modeling/heads/rec_abinet_head.py index 29450288..2309ad65 100644 --- a/ppocr/modeling/heads/rec_abinet_head.py +++ b/ppocr/modeling/heads/rec_abinet_head.py @@ -273,7 +273,8 @@ def _get_length(logit): out = out.cast('int32') out = out.argmax(-1) out = out + 1 - out = paddle.where(abn, out, paddle.full_like(out, logit.shape[1])) + len_seq = paddle.zeros_like(out) + logit.shape[1] + out = paddle.where(abn, out, len_seq) return out -- GitLab