提交 994d198e 编写于 作者: S shippingwang

add reader

上级 5203c85f
......@@ -314,6 +314,7 @@ def run(dataloader, config, net, optimizer=None, epoch=0, mode='train'):
("lr", AverageMeter(
'lr', 'f', need_avg=False)),
("batch_time", AverageMeter('elapse', '.3f')),
('reader_time', AverageMeter('reader', '.3f')),
])
else:
topk_name = 'top{}'.format(config.topk)
......@@ -324,10 +325,12 @@ def run(dataloader, config, net, optimizer=None, epoch=0, mode='train'):
("lr", AverageMeter(
'lr', 'f', need_avg=False)),
("batch_time", AverageMeter('elapse', '.3f')),
('reader_time', AverageMeter('reader', '.3f')),
])
tic = time.time()
for idx, batch in enumerate(dataloader()):
metric_list['reader_time'].update(time.time() - tic)
batch_size = len(batch[0])
feeds = create_feeds(batch, use_mix)
fetchs = create_fetchs(feeds, net, config, mode)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册