fast-stable-diffusion icon indicating copy to clipboard operation
fast-stable-diffusion copied to clipboard

Conversion error while Converting to Diffusers

Open Zurilo opened this issue 1 year ago • 6 comments

Hey! I'm trying to do DreamBooth with the Deliberate v2.ckpt model from Hugging Face, but I get this conversion error when trying to convert to diffusers.

Is there a workaround you can do about this, or is this a Deliberate model issue?

Thank you!

Converting to Diffusers ...
Traceback (most recent call last):
  File "/content/convertodiff.py", line 1130, in <module>
    convert(args)
  File "/content/convertodiff.py", line 1081, in convert
    text_encoder, vae, unet = load_models_from_stable_diffusion_checkpoint(v2_model, args.model_to_load)
  File "/content/convertodiff.py", line 846, in load_models_from_stable_diffusion_checkpoint
    info = unet.load_state_dict(converted_unet_checkpoint)
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1671, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for UNet2DConditionModel:
	Missing key(s) in state_dict: "up_blocks.0.upsamplers.0.conv.weight", "up_blocks.0.upsamplers.0.conv.bias", "up_blocks.1.upsamplers.0.conv.weight", "up_blocks.1.upsamplers.0.conv.bias", "up_blocks.2.upsamplers.0.conv.weight", "up_blocks.2.upsamplers.0.conv.bias". 
	Unexpected key(s) in state_dict: "up_blocks.0.attentions.2.conv.bias", "up_blocks.0.attentions.2.conv.weight". 
rm: cannot remove '/content/stable-diffusion-custom': No such file or directory
Conversion error
Conversion error
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-5-c3ccfb24c5ee> in <module>
    226           while not os.path.exists('/content/stable-diffusion-custom/unet/diffusion_pytorch_model.bin'):
    227             print('Conversion error')
--> 228             time.sleep(5)
    229       else:
    230         while os.path.getsize('/content/model.ckpt') < 1810671599:

KeyboardInterrupt: 

image

Zurilo avatar Mar 08 '23 01:03 Zurilo

I had the same problem for weeks

hidecreature avatar Mar 08 '23 06:03 hidecreature

Pretty sure Dreambooth is busted right now, been getting errors all day.

Dreason8 avatar Mar 08 '23 11:03 Dreason8

Try putting XpucT/Deliberate in path_to_huggingface instead.

Excalibro1 avatar Mar 08 '23 12:03 Excalibro1

100% same here when I put the model link instead of HF link, just wondering what's the conditions to meet when only loading a ckpt file, I know I can just train a lora model instead, but still wanna use the model training workflow.

z339008256 avatar Mar 08 '23 12:03 z339008256

There's a fork of Fast DB by TheOvercomer08 that can train all models, I've been using it successfully for some time now

https://github.com/theovercomer8/sd-playground

Omenizer avatar Mar 08 '23 20:03 Omenizer

There's a fork of Fast DB by TheOvercomer08 that can train all models, I've been using it successfully for some time now

https://github.com/theovercomer8/sd-playground

Even that one has the ModuleNotFoundError Dreambooth is cooked atm

Dreason8 avatar Mar 09 '23 01:03 Dreason8