You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you've trained your model using swagan, you might face issues with model weights incompatibilities:
RuntimeError: Error(s) in loading state_dict for Generator:
size mismatch for to_rgb1.bias: copying a param with shape torch.Size([1, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 1, 1]).
size mismatch for to_rgb1.conv.weight: copying a param with shape torch.Size([1, 12, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 512, 1, 1]).
size mismatch for to_rgbs.0.bias: copying a param with shape torch.Size([1, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 1, 1]).
size mismatch for to_rgbs.0.conv.weight: copying a param with shape torch.Size([1, 12, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 512, 1, 1]).
size mismatch for to_rgbs.1.bias: copying a param with shape torch.Size([1, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 1, 1]).
size mismatch for to_rgbs.1.conv.weight: copying a param with shape torch.Size([1, 12, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 512, 1, 1]).
size mismatch for to_rgbs.2.bias: copying a param with shape torch.Size([1, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 1, 1]).
size mismatch for to_rgbs.2.conv.weight: copying a param with shape torch.Size([1, 12, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 512, 1, 1]).
size mismatch for to_rgbs.3.bias: copying a param with shape torch.Size([1, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 1, 1]).
size mismatch for to_rgbs.3.conv.weight: copying a param with shape torch.Size([1, 12, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 512, 1, 1]).
size mismatch for to_rgbs.4.bias: copying a param with shape torch.Size([1, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 1, 1]).
size mismatch for to_rgbs.4.conv.weight: copying a param with shape torch.Size([1, 12, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 256, 1, 1]).
To fix this, in generator.py, change "from model import Generator" to "from swagan import Generator".
Same applies for other scripts.
The text was updated successfully, but these errors were encountered:
If you've trained your model using swagan, you might face issues with model weights incompatibilities:
RuntimeError: Error(s) in loading state_dict for Generator:
size mismatch for to_rgb1.bias: copying a param with shape torch.Size([1, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 1, 1]).
size mismatch for to_rgb1.conv.weight: copying a param with shape torch.Size([1, 12, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 512, 1, 1]).
size mismatch for to_rgbs.0.bias: copying a param with shape torch.Size([1, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 1, 1]).
size mismatch for to_rgbs.0.conv.weight: copying a param with shape torch.Size([1, 12, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 512, 1, 1]).
size mismatch for to_rgbs.1.bias: copying a param with shape torch.Size([1, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 1, 1]).
size mismatch for to_rgbs.1.conv.weight: copying a param with shape torch.Size([1, 12, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 512, 1, 1]).
size mismatch for to_rgbs.2.bias: copying a param with shape torch.Size([1, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 1, 1]).
size mismatch for to_rgbs.2.conv.weight: copying a param with shape torch.Size([1, 12, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 512, 1, 1]).
size mismatch for to_rgbs.3.bias: copying a param with shape torch.Size([1, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 1, 1]).
size mismatch for to_rgbs.3.conv.weight: copying a param with shape torch.Size([1, 12, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 512, 1, 1]).
size mismatch for to_rgbs.4.bias: copying a param with shape torch.Size([1, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 1, 1]).
size mismatch for to_rgbs.4.conv.weight: copying a param with shape torch.Size([1, 12, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([1, 3, 256, 1, 1]).
To fix this, in generator.py, change "from model import Generator" to "from swagan import Generator".
Same applies for other scripts.
The text was updated successfully, but these errors were encountered: