Skip to content

fix: resolve deprecated weight_norm in torch - #3075

Draft
Decodetalkers wants to merge 1 commit into
speechbrain:developfrom
Decodetalkers:fix/deprecated_weight_norm
Draft

Decodetalkers wants to merge 1 commit into
speechbrain:developfrom
Decodetalkers:fix/deprecated_weight_norm

Conversation

@Decodetalkers

@Decodetalkers Decodetalkers commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

resolve: #3074

This pr induced a file named torch_weight_norm.py, allow to try import the newest one, if failed , fallback to the old one. This logic was from dac.py, and I made it a separated python file

What does this PR do?

Fixes #3074

Before submitting
  • Did you read the contributor guideline?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Does your code adhere to project-specific code style and conventions?

PR review

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified
  • Confirm that the changes adhere to compatibility requirements (e.g., Python version, platform)
  • Review the self-review checklist to ensure the code is ready for review

@Decodetalkers

Copy link
Copy Markdown
Contributor Author

Ok, this place need to use lazy import.. so I need to copy the code for many times..

@Decodetalkers
Decodetalkers force-pushed the fix/deprecated_weight_norm branch 4 times, most recently from 8bd0fc8 to 58ec9e5 Compare August 26, 2026 00:33
resolve: speechbrain#3074

This pr induced a file named torch_weight_norm.py, allow to try import
the newest one, if failed , fallback to the old one. This logic was from
dac.py.
@Decodetalkers

Decodetalkers commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Is it because the pretrained model itself is using the old torch?

@Decodetalkers
Decodetalkers marked this pull request as draft August 26, 2026 00:43
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.

FutureWarning: torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.

1 participant