From 2c5965e5518915c717363bff809f66a90a0b2183 Mon Sep 17 00:00:00 2001 From: Allen Wang Date: Tue, 17 Oct 2023 18:18:54 -0700 Subject: [PATCH] add `load_strict_model_weights` as an optional config parameter (#655) --- scripts/train/train.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/train/train.py b/scripts/train/train.py index 7358d58d2e..ab3addbb07 100644 --- a/scripts/train/train.py +++ b/scripts/train/train.py @@ -383,6 +383,10 @@ def main(cfg: DictConfig) -> Trainer: 'load_weights_only', must_exist=False, default_value=False) + load_strict_model_weights: bool = pop_config(cfg, + 'load_strict_model_weights', + must_exist=False, + default_value=True) load_ignore_keys: Optional[List[str]] = pop_config(cfg, 'load_ignore_keys', must_exist=False, @@ -567,6 +571,7 @@ def main(cfg: DictConfig) -> Trainer: save_weights_only=save_weights_only, load_path=load_path, load_weights_only=load_weights_only, + load_strict_model_weights=load_strict_model_weights, load_ignore_keys=load_ignore_keys, autoresume=autoresume, python_log_level=python_log_level,