From d7bab8a6c52a72487d1bed0a28aad41e326d7622 Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Fri, 28 May 2021 09:54:50 -0700 Subject: [PATCH] Fix strict flag change for checkpoint load. --- timm/models/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timm/models/helpers.py b/timm/models/helpers.py index dfb6b860..adfef550 100644 --- a/timm/models/helpers.py +++ b/timm/models/helpers.py @@ -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)