From 92fa9341203f23522ecefc60fab69a29ab43c757 Mon Sep 17 00:00:00 2001 From: Yiming Niu Date: Sat, 5 Aug 2023 10:39:54 +0800 Subject: [PATCH] fix error in assertion when loading ckpt from config --- lavis/models/base_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lavis/models/base_model.py b/lavis/models/base_model.py index 44d66f3fc..152585400 100644 --- a/lavis/models/base_model.py +++ b/lavis/models/base_model.py @@ -98,7 +98,7 @@ def load_checkpoint_from_config(self, cfg, **kwargs): if load_pretrained: # load pre-trained weights pretrain_path = cfg.get("pretrained", None) - assert "Found load_finetuned is False, but pretrain_path is None." + assert pretrain_path is not None, "Found load_finetuned is False, but pretrain_path is None." self.load_from_pretrained(url_or_filename=pretrain_path, **kwargs) def before_training(self, **kwargs):