Closed MykhailoPoleshchukLitslink closed 3 months ago
Also with
model, vis_processors, _ = load_model_and_preprocess( name="blip_classification", model_type="base", is_eval=True, device=device )
I get
AssertionError Traceback (most recent call last) Cell In[9], line 4 1 # model, visprocessors, = load_model_and_preprocess( 2 # name="blip_classification", model_type="base", is_eval=True, device=device 3 # ) ----> 4 model, visprocessors, = load_model_and_preprocess( 5 name="blip_classification", model_type="base", is_eval=True, device=device 6 )
File ~/MA-LMM/lavis/models/init.py:198, in load_model_and_preprocess(name, model_type, is_eval, device) 195 model_cls = registry.get_model_class(name) 197 # load model --> 198 model = model_cls.from_pretrained(model_type=model_type) 200 if is_eval: 201 model.eval()
File ~/MA-LMM/lavis/models/base_model.py:69, in BaseModel.from_pretrained(cls, model_type) 59 """ 60 Build a pretrained model from default configuration file, specified by model_type. 61 (...) 66 - model (nn.Module): pretrained or finetuned model, depending on the configuration. 67 """ 68 model_cfg = OmegaConf.load(cls.default_config_path(model_type)).model ---> 69 model = cls.from_config(model_cfg) 71 return model
File ~/MA-LMM/lavis/models/blip_models/blip_classification.py:158, in BlipClassification.from_config(cls, cfg) 155 alpha = cfg.get("alpha", 0.4) 156 max_txt_len = cfg.get("max_txt_len", 40) --> 158 assert num_classes > 1, "Invalid number of classes provided, found {}".format( 159 num_classes 160 ) 162 model = cls( 163 image_encoder=image_encoder, 164 text_encoder=text_encoder, (...) 169 max_txt_len=max_txt_len, 170 ) 172 # load pre-trained weights
AssertionError: Invalid number of classes provided, found -1
Did you manually download Vicuna 7b v1.1? See https://github.com/boheumd/MA-LMM/issues/7#issuecomment-2084991618
Hello. Demo returns the following error message when I try to load the model. Also other model from model zoo can't be imported and throw different errors
model, vis_processors, _ = load_model_and_preprocess( name="blip2_vicuna_instruct_malmm", model_type="vicuna7b", is_eval=True, device=device )