From 297871d4be965b760da6ed1535fad82354cfd366 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Wed, 30 Dec 2020 19:54:16 +0800 Subject: [PATCH] fix bugs --- ppocr/metrics/__init__.py | 1 - tools/program.py | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ppocr/metrics/__init__.py b/ppocr/metrics/__init__.py index 41828f51..a0e7d912 100644 --- a/ppocr/metrics/__init__.py +++ b/ppocr/metrics/__init__.py @@ -26,7 +26,6 @@ def build_metric(config): from .det_metric import DetMetric from .rec_metric import RecMetric from .cls_metric import ClsMetric - from .rec_metric import RecMetric support_dict = ['DetMetric', 'RecMetric', 'ClsMetric'] diff --git a/tools/program.py b/tools/program.py index ce52a610..08bc4c81 100755 --- a/tools/program.py +++ b/tools/program.py @@ -179,9 +179,9 @@ def train(config, if 'start_epoch' in best_model_dict: start_epoch = best_model_dict['start_epoch'] else: - start_epoch = 0 + start_epoch = 1 - for epoch in range(start_epoch, epoch_num): + for epoch in range(start_epoch, epoch_num + 1): if epoch > 0: train_dataloader = build_dataloader(config, 'Train', device, logger) train_batch_cost = 0.0 @@ -216,7 +216,6 @@ def train(config, stats['lr'] = lr train_stats.update(stats) - #cal_metric_during_train = False if cal_metric_during_train: # onlt rec and cls need batch = [item.numpy() for item in batch] post_result = post_process_class(preds, batch[1]) -- GitLab