Inform user about unconsumed config

This commit is contained in:
Dominik Moritz Roth 2023-07-08 12:52:59 +02:00
parent db5b9ac399
commit 756c096f56

View File

@ -223,7 +223,12 @@ class Slate():
) as run: ) as run:
runner(self, run, config) runner(self, run, config)
assert not REQUIRE_CONFIG_CONSUMED or config == {}, ('Config was not completely consumed: ', config) if config != {}:
msg = ('Config was not completely consumed: ', config)
if REQUIRE_CONFIG_CONSUMED:
raise Exception(msg)
else:
print(msg)
orig_config = config orig_config = config
def _run_from_sweep(self, orig_config, p_ind): def _run_from_sweep(self, orig_config, p_ind):
@ -240,7 +245,12 @@ class Slate():
self.deep_update(config, wandb.config) self.deep_update(config, wandb.config)
runner(self, run, config) runner(self, run, config)
assert config == {}, ('Config was not completely consumed: ', config) if config != {}:
msg = ('Config was not completely consumed: ', config)
if REQUIRE_CONFIG_CONSUMED:
raise Exception(msg)
else:
print(msg)
orig_config = config orig_config = config
def from_args(self): def from_args(self):