未验证 提交 181d9f80 编写于 作者: W wangna11BD 提交者: GitHub

modify ips (#432)

上级 392d2314
......@@ -186,9 +186,9 @@ class Trainer:
self.model.setup_input(data)
self.model.train_iter(self.optimizers)
batch_cost_averager.record(time.time() - step_start_time,
num_samples=self.cfg.get(
'batch_size', 1))
batch_cost_averager.record(
time.time() - step_start_time,
num_samples=self.cfg['dataset']['train'].get('batch_size', 1))
step_start_time = time.time()
......@@ -233,7 +233,8 @@ class Trainer:
for i in range(self.max_eval_steps):
if self.max_eval_steps < self.log_interval or i % self.log_interval == 0:
self.logger.info('Test iter: [%d/%d]' %
(i * self.world_size, self.max_eval_steps * self.world_size))
(i * self.world_size,
self.max_eval_steps * self.world_size))
data = next(iter_loader)
self.model.setup_input(data)
......@@ -268,7 +269,6 @@ class Trainer:
step=self.batch_id,
is_save_image=True)
if self.metrics:
for metric_name, metric in self.metrics.items():
self.logger.info("Metric {}: {:.4f}".format(
......@@ -441,4 +441,4 @@ class Trainer:
when finish the training need close file handler or other.
"""
if self.enable_visualdl:
self.vdl_logger.close()
\ No newline at end of file
self.vdl_logger.close()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册