From f043c02c5a11b1b5d37564fa26d9f2972e861453 Mon Sep 17 00:00:00 2001 From: ryanking13 Date: Wed, 10 Mar 2021 15:10:03 +0900 Subject: [PATCH] Fix issue in feature extraction when using a local checkpoint --- timm/models/factory.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/timm/models/factory.py b/timm/models/factory.py index a7b6c90e..736b5d1d 100644 --- a/timm/models/factory.py +++ b/timm/models/factory.py @@ -55,6 +55,7 @@ def create_model( raise RuntimeError('Unknown model (%s)' % model_name) if checkpoint_path: - load_checkpoint(model, checkpoint_path) + features_only = kwargs.get("features_only", False) + load_checkpoint(model, checkpoint_path, strict=not features_only) return model