Skip to content

The provided checkpoint is not working #3

@szlll

Description

@szlll

when I loaded the model with the provided checkpoint, I found the following error:
"module 'models' has no attribute 'ICLIP_VITB16'. Did you mean: 'ACLIP_VITB16'?"

Here is my code to load the model:

ckpt_path = "/path/to/provided/checkpoint_best.pt"
ckpt = torch.load(ckpt_path, map_location='cpu')
state_dict = OrderedDict()
for k, v in ckpt['state_dict'].items():
state_dict[k.replace('module.', '')] = v

old_args = ckpt['args']
print("=> creating model: {}".format(old_args.model))
detailclip = getattr(models, old_args.model)()
detailclip.cuda()
detailclip.load_state_dict(state_dict, strict=True)
print("=> loaded resume checkpoint '{}' (epoch {})".format(args.resume, ckpt['epoch']))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions