Skip to content

when i load model, not found key variable #86

@JadeKim042386

Description

@JadeKim042386

if not load_head:
if 'model' in state:
key = 'model'
else:
key = 'state_dict'
filtered_dict = {k: v for k, v in state[key].items() if
(k in model.state_dict() and 'head.fc' not in k)}
model.load_state_dict(filtered_dict, strict=False)
else:
model.load_state_dict(state[key], strict=True)

when load_head is True, it didn't defined key.

+ i know solution. so, i just notified this problem. plz fix it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions