KeyError: 'time_embed.0.weight'
diffusers version : 0.18.2 code :
from torch import autocast
from diffusers import StableDiffusionPipeline
pipeline = StableDiffusionPipeline.from_single_file("https://huggingface.co/xiaolxl/GuoFeng3/blob/main/GuoFeng3.2_Lora.safetensors")
pipeline.to("cuda")
with autocast("cuda"):
image = pipeline("best quality,masterpiece,highres,1girl,blush,(seductive smile:0.8),star-shaped pupils,red china hanfu,hanfu,chinese clothes,hair ornament,necklace,jewelry,Beautiful face,upon_body,tyndall effect,photorealistic,dark studio,rim lighting,two tone lighting,(high detailed skin:1.2),8k uhd,dslr,soft lighting,high quality,volumetric lighting,candid,Photograph,high resolution,4k,8k,Bokeh,").images[0]
image.save("test.png")
I run this on the google colab, but I got the error: KeyError: 'time_embed.0.weight'. I will give the whole error message below:
`
KeyError Traceback (most recent call last)
2 frames /usr/local/lib/python3.10/dist-packages/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py in convert_ldm_unet_checkpoint(checkpoint, config, path, extract_ema, controlnet, skip_extract_state_dict) 419 new_checkpoint = {} 420 --> 421 new_checkpoint["time_embedding.linear_1.weight"] = unet_state_dict["time_embed.0.weight"] 422 new_checkpoint["time_embedding.linear_1.bias"] = unet_state_dict["time_embed.0.bias"] 423 new_checkpoint["time_embedding.linear_2.weight"] = unet_state_dict["time_embed.2.weight"]
KeyError: 'time_embed.0.weight' `
Any Idea on how you fixed it ?
i changed base model and it worked
Also running into this... any fix?
Just ran into this issue while loading a UNet2DModel I fine-tuned.
pipe = StableDiffusionPipeline.from_single_file("/train3/unet/diffusion_pytorch_model.safetensors")
is causing issue.