未验证 提交 26289ce0 编写于 作者: R ruri 提交者: GitHub

Merge pull request #259 from shippingwang/reader_time

Reader time
......@@ -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.
先完成此消息的编辑!
想要评论请 注册