提交 3197c82c 编写于 作者: S shippingwang

refine

上级 4870bd37
...@@ -73,7 +73,7 @@ def main(args): ...@@ -73,7 +73,7 @@ def main(args):
valid_dataloader.set_sample_list_generator(valid_reader, place) valid_dataloader.set_sample_list_generator(valid_reader, place)
compiled_valid_prog = program.compile(config, valid_prog) compiled_valid_prog = program.compile(config, valid_prog)
program.run(valid_dataloader, exe, compiled_valid_prog, valid_fetchs, 0, program.run(valid_dataloader, exe, compiled_valid_prog, valid_fetchs, -1,
'valid') 'valid')
......
...@@ -385,7 +385,15 @@ def run(dataloader, exe, program, fetchs, epoch=0, mode='train'): ...@@ -385,7 +385,15 @@ def run(dataloader, exe, program, fetchs, epoch=0, mode='train'):
metric_list[i].update(m[0], len(batch[0])) metric_list[i].update(m[0], len(batch[0]))
fetchs_str = ''.join([str(m.value)+' ' fetchs_str = ''.join([str(m.value)+' '
for m in metric_list]+ [batch_time.value]) for m in metric_list]+ [batch_time.value])
logger.info("epoch:{:<3d} {:s} step:{:<4d} {:s}s".format( if epoch != -1:
logger.info("epoch:{:<3d} {:s} step:{:<4d} {:s}s".format(
epoch, mode, idx, fetchs_str)) epoch, mode, idx, fetchs_str))
else:
logger.info("{:s} step:{:<4d} {:s}s".format(
mode, idx, fetchs_str))
end_str = ''.join([str(m.mean)+' ' for m in metric_list] + [batch_time.total]) end_str = ''.join([str(m.mean)+' ' for m in metric_list] + [batch_time.total])
logger.info("END epoch:{:<3d} {:s} {:s}s".format(epoch, mode, end_str)) if epoch!= -1:
logger.info("END epoch:{:<3d} {:s} {:s}s".format(epoch, mode, end_str))
else:
logger.info("END {:s} {:s}s".format(mode, end_str))
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册