Skip to content

Commit

Permalink
tracking hpc_exp_number property
Browse files Browse the repository at this point in the history
  • Loading branch information
williamFalcon committed Jul 8, 2019
1 parent bc0edf1 commit 9256cb2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test_tube/hpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def __init__(
self.call_load_checkpoint = False
self.commands = []
self.slurm_commands = []
self.hpc_exp_number = 0

# these are set via getters and setters so we can use a BaseManager which can be shared across processes
self.checkpoint_save_function = None
Expand All @@ -62,6 +63,7 @@ def __init__(
# detect when this was called because a slurm object started a hopt.
# if true, remove the flag so tt logs don't show it
if hyperparam_optimizer is not None:

self.is_from_slurm_object = HyperOptArgumentParser.TRIGGER_CMD in vars(self.hyperparam_optimizer) and vars(self.hyperparam_optimizer)[HyperOptArgumentParser.TRIGGER_CMD] == True
if self.is_from_slurm_object:
self.hyperparam_optimizer.__delattr__(HyperOptArgumentParser.TRIGGER_CMD)
Expand All @@ -70,6 +72,8 @@ def __init__(
if self.call_load_checkpoint:
self.hyperparam_optimizer.__delattr__(HyperOptArgumentParser.SLURM_LOAD_CMD)

self.hpc_exp_number = self.hyperparam_optimizer.hpc_exp_number

def set_checkpoint_save_function(self, fx, kwargs):
self.checkpoint_save_function = [fx, kwargs]

Expand Down

0 comments on commit 9256cb2

Please sign in to comment.