Commit a68d28c9 authored by ly015's avatar ly015 Committed by Wenwei Zhang
Browse files

close writer in after_run

parent 9071202f
......@@ -100,6 +100,10 @@ class PaviLoggerHook(LoggerHook):
snapshot_file_path=ckpt_path,
iteration=iteration)
# flush the buffer and send a task ending signal to Pavi
if hasattr(self, 'writer'):
self.writer.close()
@master_only
def before_epoch(self, runner):
if runner.epoch == 0 and self.add_graph:
......@@ -112,7 +116,3 @@ class PaviLoggerHook(LoggerHook):
image = data[self.img_key][0:1].to(device)
with torch.no_grad():
self.writer.add_graph(_model, image)
def __del__(self):
if hasattr(self, 'writer'):
self.writer.close()
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