Skip to content

Commit

Permalink
add load_strict_model_weights as an optional config parameter (#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenHW authored Oct 18, 2023
1 parent cc238a3 commit 2c5965e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2c5965e

Please sign in to comment.