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

Handle DAC conversion when using weight_norm with newer PyTorch versions #36393

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

edwko
Copy link

@edwko edwko commented Feb 25, 2025

What does this PR do?

nn.utils.weight_norm has been moved to nn.utils.parametrizations.weight_norm. As a result, parametrized layers no longer expose weight_g or weight_v, but only weight. This causes an AttributeError when DAC conversion attempts to access weights:

AttributeError: 'ParametrizedConv1d' object has no attribute 'weight_g'. Did you mean: 'weight'?

This PR moves apply_weight_norm directly into the script, explicitly setting to use weight_norm = nn.utils.weight_norm to ensure compatibility.

@xenova
Copy link
Contributor

xenova commented Feb 25, 2025

cc @kamilakesbi, who made the original conversions (do they still work with the existing conversion scripts?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants