Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
CoderZhangYx opened this issue Aug 5, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@CoderZhangYx
Copy link
Collaborator

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

@CoderZhangYx CoderZhangYx added the help wanted Extra attention is needed label Aug 5, 2024
@AmirulOm
Copy link

AmirulOm commented Aug 14, 2024

Having a same problems, following this threads for updates.

My environment :

  • Ubuntu 20.04
  • Python 3.10 : deadsnake
  • torch==2.2.2
  • torchvision==0.17.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants