mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2026-09-24 23:33:08 +08:00
fix bugs
This commit is contained in:
@@ -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']
|
||||
|
||||
|
||||
+2
-3
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user