mirror of
https://github.com/gryf/coach.git
synced 2025-12-17 19:20:19 +01:00
bug-fix for checkpointing for single-worker algorithms
This commit is contained in:
@@ -426,8 +426,10 @@ class GraphManager(object):
|
|||||||
def save_checkpoint(self):
|
def save_checkpoint(self):
|
||||||
# only the chief process saves checkpoints
|
# only the chief process saves checkpoints
|
||||||
if self.task_parameters.save_checkpoint_secs \
|
if self.task_parameters.save_checkpoint_secs \
|
||||||
and time.time() - self.last_checkpoint_saving_time >= self.task_parameters.save_checkpoint_secs\
|
and time.time() - self.last_checkpoint_saving_time >= self.task_parameters.save_checkpoint_secs \
|
||||||
and self.task_parameters.task_index == 0:
|
and (self.task_parameters.task_index == 0 # distributed
|
||||||
|
or self.task_parameters.task_index is None # single-worker
|
||||||
|
):
|
||||||
|
|
||||||
checkpoint_path = os.path.join(self.task_parameters.save_checkpoint_dir,
|
checkpoint_path = os.path.join(self.task_parameters.save_checkpoint_dir,
|
||||||
"{}_Step-{}.ckpt".format(
|
"{}_Step-{}.ckpt".format(
|
||||||
|
|||||||
Reference in New Issue
Block a user