Merge pull request #95 from PaddlePaddle/fix
fix tensorboard error https://github.com/pytorch/fairseq/issues/2357
This commit is contained in:
commit
3ebe5ccb33
|
@ -195,6 +195,8 @@ class ExperimentBase(object):
|
|||
except KeyboardInterrupt:
|
||||
self.save()
|
||||
exit(-1)
|
||||
finally:
|
||||
self.destory()
|
||||
|
||||
def setup_output_dir(self):
|
||||
"""Create a directory used for output.
|
||||
|
@ -218,6 +220,11 @@ class ExperimentBase(object):
|
|||
|
||||
self.checkpoint_dir = checkpoint_dir
|
||||
|
||||
@mp_tools.rank_zero_only
|
||||
def destory(self):
|
||||
# https://github.com/pytorch/fairseq/issues/2357
|
||||
self.visualizer.close()
|
||||
|
||||
@mp_tools.rank_zero_only
|
||||
def setup_visualizer(self):
|
||||
"""Initialize a visualizer to log the experiment.
|
||||
|
|
Loading…
Reference in New Issue