NVlabs / SPADE

Semantic Image Synthesis with SPADE
https://nvlabs.github.io/SPADE/
Other
7.61k stars 980 forks source link

Cannot load pretrained model with --use_vae #115

Open keerthan2 opened 4 years ago

keerthan2 commented 4 years ago

When i try to load the pretrained model (for ade20k) with --use_vae as True, I get the following error

RuntimeError: Error(s) in loading state_dict for SPADEGenerator:
        size mismatch for fc.weight: copying a param with shape torch.Size([1024, 151, 3, 3]) from checkpoint, the shape in current model is torch.Size([65536, 256]).
        size mismatch for fc.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([65536]).

Is there any work around for this ?

bindita commented 4 years ago

I don't think so. Unfortunately the generator architecture is different for the first layer (Linear for vae, Conv2D otherwise). So one cannot load the G from a non-vae framework into the vae framework, or test with a vae-trained model without encoder.