Unverified Commit c203419f authored by Harry's avatar Harry Committed by GitHub
Browse files

fix: deadlock if processes have different log_buffer (#252)

parent 0c34ab90
......@@ -98,13 +98,16 @@ class TextLoggerHook(LoggerHook):
log_dict['iter'] = runner.inner_iter + 1
# only record lr of the first param group
log_dict['lr'] = runner.current_lr()[0]
memory = None
if torch.cuda.is_available():
memory = self._get_max_memory(runner)
if mode == 'train':
log_dict['time'] = runner.log_buffer.output['time']
log_dict['data_time'] = runner.log_buffer.output['data_time']
# statistic memory
if torch.cuda.is_available():
log_dict['memory'] = self._get_max_memory(runner)
if memory is not None:
log_dict['memory'] = memory
for name, val in runner.log_buffer.output.items():
if name in ['time', 'data_time']:
continue
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment