fix vector ips log bug, test=doc

pull/1630/head
xiongxinlei 3 years ago
parent 567286add3
commit 4af007c3fc

@ -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:

Loading…
Cancel
Save