ControlNet-for-Diffusers icon indicating copy to clipboard operation
ControlNet-for-Diffusers copied to clipboard

Unexpected key(s) in state_dict: "text_model.embeddings.position_ids".

Open mrjchen opened this issue 1 year ago • 1 comments

Sorry to bother you.When i try to python ./scripts/convert_controlnet_to_diffusers.py --checkpoint_path ../models/control_any3_openpose.pth --dump_path control_any3_openpose --device cpu. Something went wrong. global_step key not found in model Traceback (most recent call last): File "./scripts/convert_controlnet_to_diffusers.py", line 105, in pipe = load_pipeline_from_control_net_ckpt( File "/home/jjc/anaconda3/envs/m3/lib/python3.8/site-packages/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py", line 1566, in load_pipeline_from_control_net_ckpt text_model = convert_ldm_clip_checkpoint(checkpoint) File "/home/jjc/anaconda3/envs/m3/lib/python3.8/site-packages/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py", line 847, in convert_ldm_clip_checkpoint text_model.load_state_dict(text_model_dict) File "/home/jjc/anaconda3/envs/m3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1482, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for CLIPTextModel: Unexpected key(s) in state_dict: "text_model.embeddings.position_ids".

mrjchen avatar Aug 30 '23 17:08 mrjchen

Hi I have the same error, can you share how do you solve it? Thanks.

Awj2021 avatar May 15 '24 07:05 Awj2021