diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

"NameError: name 'init_empty_weights' is not defined" when accelerate is not installed

Open cstueckrath opened this issue 3 years ago • 4 comments

https://github.com/huggingface/diffusers/blame/92a57a8e84a98a4da87b6a0621615eed4a23edc4/src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py#L1344

init_empty_weights() is imported from accelerate if is_accelerate_available() returns true. However if that's not the case there is no fallback. We had to pin diffusers to 0.18.1 in https://github.com/nod-ai/SHARK/pull/1648

cstueckrath avatar Jul 13 '23 11:07 cstueckrath

Can you install accelerate - we more or less enforce it now with this PR: https://github.com/huggingface/diffusers/pull/4078

Think accelerate is very lightweight so it shouldn't really create a problem no?

patrickvonplaten avatar Jul 14 '23 01:07 patrickvonplaten

I see. Shouldn't this be then set as a dependency for pip installs of Diffusers?

cstueckrath avatar Jul 14 '23 07:07 cstueckrath

We would do this if we wouldn't support FLAX but with when running diffusers on FLAX one really doesn't need accelerate

patrickvonplaten avatar Jul 17 '23 14:07 patrickvonplaten

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Aug 12 '23 15:08 github-actions[bot]