mueller-franzes / medfusion

Implementation of Medfusion - A latent diffusion model for medical image synthesis.
MIT License
165 stars 32 forks source link

Model checkpoint loading errors due to size mismatch #30

Open Idris014 opened 2 weeks ago

Idris014 commented 2 weeks ago

I'm encountering issues loading model checkpoints, resulting in multiple size mismatch errors. Here is the context and the errors encountered:

Problem I attempted to load the model checkpoint. However, there are numerous size mismatches in the parameters when trying to load from the upgraded checkpoints.

Errors:

RuntimeError: Error(s) in loading state_dict for DiffusionPipeline:
    size mismatch for latent_embedder.out_enc.0.conv.weight: copying a param with shape torch.Size([8, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([16, 512, 3, 3]).
    size mismatch for latent_embedder.out_enc.0.conv.bias: copying a param with shape torch.Size([8]) from checkpoint, the shape in current model is torch.Size([16]).
    ...

Could you provide guidance on how to properly address these mismatches?

Thank you!