CHatGPT tells me i need to init BEFORE I sweep
This commit is contained in:
parent
f484e9d24c
commit
373346b589
@ -263,8 +263,16 @@ class Slate():
|
|||||||
def _run_process(self, orig_config, rep_ids, p_ind):
|
def _run_process(self, orig_config, rep_ids, p_ind):
|
||||||
config = copy.deepcopy(orig_config)
|
config = copy.deepcopy(orig_config)
|
||||||
if self.consume(config, 'sweep.enable', False):
|
if self.consume(config, 'sweep.enable', False):
|
||||||
wandbC = copy.deepcopy(config['wandb'])
|
wandbC = self.consume(copy.deepcopy(orig_config), 'wandb', {}, expand=True)
|
||||||
wandb.agent(self.sweep_id, function=partial(self._run_from_sweep, config, p_ind=p_ind), count=len(rep_ids))
|
project = self.consume(wandbC, 'project')
|
||||||
|
|
||||||
|
with wandb.init(
|
||||||
|
project=project,
|
||||||
|
reinit=self.consume(wandbC, 'reinit', DEFAULT_REINIT),
|
||||||
|
settings=wandb.Settings(**self.consume(wandbC, 'settings', {})),
|
||||||
|
**wandbC
|
||||||
|
) as run:
|
||||||
|
wandb.agent(self.sweep_id, function=partial(self._run_from_sweep, config, run, p_ind=p_ind), count=len(rep_ids))
|
||||||
else:
|
else:
|
||||||
self.consume(config, 'sweep', {})
|
self.consume(config, 'sweep', {})
|
||||||
self._run_single(config, rep_ids, p_ind=p_ind)
|
self._run_single(config, rep_ids, p_ind=p_ind)
|
||||||
@ -297,31 +305,24 @@ class Slate():
|
|||||||
print(msg)
|
print(msg)
|
||||||
orig_config = config
|
orig_config = config
|
||||||
|
|
||||||
def _run_from_sweep(self, orig_config, p_ind):
|
def _run_from_sweep(self, orig_config, run, p_ind):
|
||||||
runnerName, wandbC = self.consume(orig_config, 'runner'), self.consume(orig_config, 'wandb', {}, expand=True)
|
runnerName = self.consume(orig_config, 'runner')
|
||||||
project = self.consume(wandbC, 'project')
|
|
||||||
|
|
||||||
Runner = self.runners[runnerName]
|
Runner = self.runners[runnerName]
|
||||||
|
|
||||||
with wandb.init(
|
config = copy.deepcopy(orig_config)
|
||||||
project=project,
|
self.deep_update(config, wandb.config)
|
||||||
reinit=self.consume(wandbC, 'reinit', DEFAULT_REINIT),
|
run.config = copy.deepcopy(config)
|
||||||
settings=wandb.Settings(**self.consume(wandbC, 'settings', {})),
|
runner = Runner(self, config)
|
||||||
**wandbC
|
runner.setup()
|
||||||
) as run:
|
runner.run(run)
|
||||||
config = copy.deepcopy(orig_config)
|
|
||||||
self.deep_update(config, wandb.config)
|
|
||||||
run.config = copy.deepcopy(config)
|
|
||||||
runner = Runner(self, config)
|
|
||||||
runner.setup()
|
|
||||||
runner.run(run)
|
|
||||||
|
|
||||||
if config != {}:
|
if config != {}:
|
||||||
msg = ('Config was not completely consumed: ', config)
|
msg = ('Config was not completely consumed: ', config)
|
||||||
if REQUIRE_CONFIG_CONSUMED:
|
if REQUIRE_CONFIG_CONSUMED:
|
||||||
raise Exception(msg)
|
raise Exception(msg)
|
||||||
else:
|
else:
|
||||||
print(msg)
|
print(msg)
|
||||||
orig_config = config
|
orig_config = config
|
||||||
|
|
||||||
def from_args(self):
|
def from_args(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user