Open lucasjinreal opened 3 years ago
@lucidrains Hi, thanks for your reply. Those code seems very clean and simple, but it's too simple. I wanna know what's happened inside.
I found a weried issue on my side, somehow I trained a model with latent dim is 256, because the error messages told me:
size mismatch for G.blocks.2.to_noise1.weight: copying a param with shape torch.Size([256, 1]) from checkpoint, the shape in current model is torch.Size([512, 1]).
the G which is should be this model:
self.G = Generator(image_size, latent_dim, network_capacity, transparent=transparent,
attn_layers=attn_layers, no_const=no_const, fmap_max=fmap_max)
But I set lantent_dim to 256, I got shape missmatch of S model which is StyleVectorizer:
self.S = StyleVectorizer(latent_dim, style_depth, lr_mul=lr_mlp)
Set to latent_dim 256 got:
size mismatch for S.net.0.weight: copying a param with shape torch.Size([512, 512]) from checkpoint, the shape in current model is torch.Size([256, 256]).
this time mismatch from S model.
So, here is the problem:
Generate and StyleVectoriter saved weights shape not same, first one 256 while S is 512, how could this possible?
From the code you defined:
self.S = StyleVectorizer(latent_dim, style_depth, lr_mul=lr_mlp)
self.G = Generator(image_size, latent_dim, network_capacity, transparent=transparent,
attn_layers=attn_layers, no_const=no_const, fmap_max=fmap_max)
they should all be latent_dim ??
Hi, I am new to StyleGAN. I want write a simple inference demo to generate a single image using a simple noise latent vector by random.
I am currently got this:
I am runing the default model with image size 512. But I got shape mistach error here:
I tried change the latent dim to either 512 or 256, but all failed to load the model trained.
If you can have a look at me code, it would be very much appreciated!