1
0
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:
Gal Leibovich
2018-08-19 20:17:15 +03:00
parent 9f599f38cf
commit c1f428666e

View File

@@ -427,7 +427,9 @@ class GraphManager(object):
# only the chief process saves checkpoints
if 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,
"{}_Step-{}.ckpt".format(