RelViT icon indicating copy to clipboard operation
RelViT copied to clipboard

Load checkpoint to inference for image embeddings

Open haophancs opened this issue 2 months ago • 0 comments

Hi, could you please provide the instruction to load the provided checkpoint? I want to inference the model for image embeddings.

I have tried as below but it’s wrong:

import torch
from models.swin_transformer import swin_base

model = swin_base()
sd = torch.load('./swin_base_original_gqa.pth', map_location='cpu')['state_dict']
model.load_state_dict(sd, strict=False)

# _IncompatibleKeys(missing_keys=['patch_embed'patch_embed.proj.weight', 'patch_embed.proj.bias', 'patch_embed.norm.weight', 'patch_embed.norm.bias', 'layers.0.blocks.0.norm1.weight'. ...]

haophancs avatar Apr 15 '24 15:04 haophancs