tencent-ailab / IP-Adapter

The image prompt adapter is designed to enable a pretrained text-to-image diffusion model to generate images with image prompt.
Apache License 2.0
4.52k stars 298 forks source link

Error(s) in loading state_dict for MLPProjModel #230

Closed pelipas31 closed 6 months ago

pelipas31 commented 6 months ago

Please help me figure it out. In the most basic workflow it produces the following error. (mac m3)

Error occurred when executing IPAdapterApply:

Error(s) in loading state_dict for MLPProjModel: size mismatch for proj.0.weight: copying a param with shape torch.Size([1280, 1280]) from checkpoint, the shape in current model is torch.Size([1024, 1024]). size mismatch for proj.0.bias: copying a param with shape torch.Size([1280]) from checkpoint, the shape in current model is torch.Size([1024]). size mismatch for proj.2.weight: copying a param with shape torch.Size([768, 1280]) from checkpoint, the shape in current model is torch.Size([768, 1024]).

ip_ad

joaomsimoes commented 6 months ago

RuntimeError: Error(s) in loading state_dict for MLPProjModel: size mismatch for proj.2.weight: copying a param with shape torch.Size([8192, 1024]) from checkpoint, the shape in current model is torch.Size([3072, 1024]). size mismatch for proj.2.bias: copying a param with shape torch.Size([8192]) from checkpoint, the shape in current model is torch.Size([3072]). size mismatch for norm.weight: copying a param with shape torch.Size([2048]) from checkpoint, the shape in current model is torch.Size([768]). size mismatch for norm.bias: copying a param with shape torch.Size([2048]) from checkpoint, the shape in current model is torch.Size([768]).

I have the same issue running the code provided at Huggingface

pelipas31 commented 6 months ago

I realized what the problem is, I didn’t download all the models into the clip visipn, I need to use "model.safetensors" instead pytorch_model