提交 4af007c3 编写于 作者: X xiongxinlei

fix vector ips log bug, test=doc

上级 567286ad
......@@ -225,7 +225,7 @@ def main(args, config):
print_msg += ' avg_train_cost: {:.5f} sec,'.format(
train_run_cost / config.log_interval)
print_msg += ' lr={:.4E} step/sec={:.2f} ips={:.2f}| ETA {}'.format(
print_msg += ' lr={:.4E} step/sec={:.2f} ips:{:.5f}| ETA {}'.format(
lr, timer.timing, timer.ips, timer.eta)
logger.info(print_msg)
......
......@@ -23,7 +23,7 @@ class Timer(object):
self.last_start_step = 0
self.current_step = 0
self._is_running = True
self.ips = 0
self.cur_ips = 0
def start(self):
self.last_time = time.time()
......@@ -44,7 +44,7 @@ class Timer(object):
self.last_start_step = self.current_step
time_used = time.time() - self.last_time
self.last_time = time.time()
self.ips = run_steps / time_used
self.cur_ips = run_steps / time_used
return time_used / run_steps
@property
......@@ -53,7 +53,7 @@ class Timer(object):
@property
def ips(self) -> float:
return self.ips
return self.cur_ips
@property
def eta(self) -> str:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册