mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2025-06-03 21:53:39 +08:00
修复ips和batch_cost输出错误的bug
This commit is contained in:
parent
0c287c41ea
commit
40023f76a6
@ -236,7 +236,6 @@ def train(config,
|
||||
train_batch_cost = 0.0
|
||||
train_reader_cost = 0.0
|
||||
batch_sum = 0
|
||||
batch_start = time.time()
|
||||
# eval
|
||||
if global_step > start_eval_step and \
|
||||
(global_step - start_eval_step) % eval_batch_step == 0 and dist.get_rank() == 0:
|
||||
@ -275,6 +274,7 @@ def train(config,
|
||||
best_model_dict[main_indicator],
|
||||
global_step)
|
||||
global_step += 1
|
||||
batch_start = time.time()
|
||||
if dist.get_rank() == 0:
|
||||
save_model(
|
||||
model,
|
||||
@ -334,7 +334,9 @@ def eval(model, valid_dataloader, post_process_class, eval_class):
|
||||
|
||||
|
||||
def save_inference_mode(model, config, logger):
|
||||
if dist.get_rank() == 0:
|
||||
model.eval()
|
||||
print('infer')
|
||||
save_path = '{}/infer/{}'.format(config['Global']['save_model_dir'],
|
||||
config['Architecture']['model_type'])
|
||||
if config['Architecture']['model_type'] == 'rec':
|
||||
|
Loading…
x
Reference in New Issue
Block a user