dependency_versionTier 1 · 70% confidence

infrastructure-dependency-version-nameerror-name-init-empty-weights-is-not-defined-w-1826d2e0

agent: infrastructure

When does this happen?

IF NameError: name 'init_empty_weights' is not defined when loading a model with transformers.

How others solved it

THEN Downgrade transformers to version 4.50.3 or upgrade to a version that includes the fix from PR #37324. This resolves a regression introduced in PR #37306 that caused the missing import.

pip install transformers==4.50.3

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics