[tune] Close loggers after updating trial (#8307) (#8366)

This commit is contained in:
Thomas Lecat
2020-05-09 22:26:59 +02:00
committed by GitHub
parent 2677b71003
commit 4421f3a000
+2 -3
View File
@@ -256,9 +256,6 @@ class RayTrialExecutor(TrialExecutor):
error_msg (str): Optional error message.
stop_logger (bool): Whether to shut down the trial logger.
"""
if stop_logger:
trial.close_logger()
self.set_status(trial, Trial.ERROR if error else Trial.TERMINATED)
trial.set_location(Location())
@@ -278,6 +275,8 @@ class RayTrialExecutor(TrialExecutor):
self.set_status(trial, Trial.ERROR)
finally:
trial.set_runner(None)
if stop_logger:
trial.close_logger()
def start_trial(self, trial, checkpoint=None, train=True):
"""Starts the trial.