EricDai0 / advdiff

MIT License
20 stars 3 forks source link

Can not load checkpoint from "models/ldm/cin256-v2/model.ckpt" #1

Closed Ace0001 closed 10 months ago

Ace0001 commented 10 months ago

Thank you sincerely for your interesting work. While running the code, I encountered an issue loading the checkpoint you provided. I wanted to confirm if the current checkpoint in 'models/ldm/cin256-v2/' is the correct one?

EricDai0 commented 10 months ago

No, it's just a placeholder. You should download it yourself (https://ommer-lab.com/files/latent-diffusion/cin.zip) and place it in "models/ldm/cin256-v2/".

Ace0001 commented 10 months ago

Thanks a lot! Also, I'm wondering where the ldm.util file is located. I don't think there's a util.py in the ldm directory.

Ace0001 commented 10 months ago

Thanks for the newly uploaded utils.py. When I ran the code, I encountered another problem. The cin256-v2.yaml file is not compatible with the checkpoint you suggested (https://ommer-lab.com/files/latent-diffusion/cin.zip). It gives the following error: RuntimeError: Error(s) in loading state_dict for LatentDiffusion: size mismatch for model.diffusion_model.time_embed.0.weight: copying a param with shape torch.Size([1024, 256]) from checkpoint, the shape in current model is torch.Size([768, 192]). size mismatch for model.diffusion_model.time_embed.0.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([768]). size mismatch for model.diffusion_model.time_embed.2.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([768, 768]). size mismatch for model.diffusion_model.time_embed.2.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([768]). ... size mismatch for first_stage_model.post_quant_conv.bias: copying a param with shape torch.Size([4]) from checkpoint, the shape in current model is torch.Size([3]). size mismatch for cond_stage_model.embedding.weight: copying a param with shape torch.Size([1000, 512]) from checkpoint, the shape in current model is torch.Size([1001, 512]).

What steps can I take to resolve this issue?

gq-max commented 10 months ago

you should download checkpoint from https://ommer-lab.com/files/latent-diffusion/nitro/cin/model.ckpt

Ace0001 commented 10 months ago

Thank you for your help.

EricDai0 commented 10 months ago

you should download checkpoint from https://ommer-lab.com/files/latent-diffusion/nitro/cin/model.ckpt

Thank you for the help.