Fix strict flag change for checkpoint load.

This commit is contained in:
Ross Wightman 2021-05-28 09:54:50 -07:00
parent 9c78de8c02
commit d7bab8a6c5

View File

@ -44,7 +44,7 @@ def load_state_dict(checkpoint_path, use_ema=False):
raise FileNotFoundError()
def load_checkpoint(model, checkpoint_path, use_ema=False, strict=False):
def load_checkpoint(model, checkpoint_path, use_ema=False, strict=True):
state_dict = load_state_dict(checkpoint_path, use_ema)
model.load_state_dict(state_dict, strict=strict)