Closed empty2enrich closed 5 months ago
code
model = cls( vit_model=vit_model, img_size=img_size, drop_path_rate=drop_path_rate, use_grad_checkpoint=use_grad_checkpoint, vit_precision=vit_precision, freeze_vit=freeze_vit, num_query_token=num_query_token, cross_attention_freq=cross_attention_freq, max_txt_len=max_txt_len, ) if pretrained_model_path.startswith('http'): print('start download seed model...') cached_file = download_cached_file(pretrained_model_path, check_hash=False, progress=True) print(cached_file) ckpt = torch.load(cached_file, map_location="cpu") else: ckpt = torch.load(pretrained_model_path, map_location="cpu") missing, unexcepted = model.load_state_dict(ckpt, strict=False) print('missing keys: ', len(missing), 'unexpected keys:', len(unexcepted)) return model
Will not have an impact on the outcome : )
code