Skip to content

load_state_dict via wandb artifact -> missing keys  #37

@rowandempster

Description

@rowandempster

Reproduction steps:

model = AVA_model(opt['model'])

ckpt = api.artifact('wato-action-classification/acar/models:v18').get_path('ckpt_11.pth.tar').download('/home/docker/catkin_ws/src/ACAR-Net/pretrained')

model.load_state_dict(torch.load(ckpt)['state_dict'])

yields Missing Keys: backbone.module.fast_conv1.weight.

Root cause: torch.load(ckpt)['state_dict'] contains keys in the format module.backbone.module.fast_conv1.weight (note the extra module. prepended).

Proposed resolution: Figure out why the state dict is being saved with the module. prepended and remove it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions