提交 297871d4 编写于 作者: T tink2123

fix bugs

上级 c1fd4664
...@@ -26,7 +26,6 @@ def build_metric(config): ...@@ -26,7 +26,6 @@ def build_metric(config):
from .det_metric import DetMetric from .det_metric import DetMetric
from .rec_metric import RecMetric from .rec_metric import RecMetric
from .cls_metric import ClsMetric from .cls_metric import ClsMetric
from .rec_metric import RecMetric
support_dict = ['DetMetric', 'RecMetric', 'ClsMetric'] support_dict = ['DetMetric', 'RecMetric', 'ClsMetric']
......
...@@ -179,9 +179,9 @@ def train(config, ...@@ -179,9 +179,9 @@ def train(config,
if 'start_epoch' in best_model_dict: if 'start_epoch' in best_model_dict:
start_epoch = best_model_dict['start_epoch'] start_epoch = best_model_dict['start_epoch']
else: 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: if epoch > 0:
train_dataloader = build_dataloader(config, 'Train', device, logger) train_dataloader = build_dataloader(config, 'Train', device, logger)
train_batch_cost = 0.0 train_batch_cost = 0.0
...@@ -216,7 +216,6 @@ def train(config, ...@@ -216,7 +216,6 @@ def train(config,
stats['lr'] = lr stats['lr'] = lr
train_stats.update(stats) train_stats.update(stats)
#cal_metric_during_train = False
if cal_metric_during_train: # onlt rec and cls need if cal_metric_during_train: # onlt rec and cls need
batch = [item.numpy() for item in batch] batch = [item.numpy() for item in batch]
post_result = post_process_class(preds, batch[1]) post_result = post_process_class(preds, batch[1])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册