Skip to content

Why warning "A parameter name that contains gamma will be renamed internally to weight." #8

@CoderZhangYx

Description

@CoderZhangYx

As mentioned in SAM-2 Issue 85, there are modules named "gamma" in SAM-2's memory encoder, which is conflict with transformers. (transformers forbid module names "gamma" or "beta")
To solve this problem, we manually rename "gamma" in SAM-2 modelscript to "weight". The checkpoint can be load properly because transformers api will rename "gamma" in state dict to "weight".

We believe it is rude to modify module name of others' models. Please tell us if you have any other better ways to solve this problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions