This commit is contained in:
Hui Zhang 2021-02-18 19:53:58 +08:00
parent a3de28cbe0
commit c955c4192b
1 changed files with 7 additions and 0 deletions

View File

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