Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size mismatch #22

Closed
TheGullahanMaster opened this issue May 4, 2022 · 1 comment
Closed

Size mismatch #22

TheGullahanMaster opened this issue May 4, 2022 · 1 comment

Comments

@TheGullahanMaster
Copy link

/home/jirib/anaconda3/envs/pytorch/lib/python3.9/site-packages/torch/distributed/launch.py:178: FutureWarning: The module torch.distributed.launch is deprecated and will be removed in future. Use torchrun. Note that --use_env is set by default in torchrun. If your script expects --local_rankargument to be set, please change it to read fromos.environ['LOCAL_RANK']` instead. See
https://pytorch.org/docs/stable/distributed.html#launch-utility for
further instructions

warnings.warn(
/home/jirib/anaconda3/envs/pytorch/lib/python3.9/site-packages/torch/functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /opt/conda/conda-bld/pytorch_1634272068185/work/aten/src/ATen/native/TensorShape.cpp:2157.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
load model: samples000001.pt
Traceback (most recent call last):
File "/home/jirib/Desktop/StyleSwin-main/train_styleswin.py", line 410, in
generator.load_state_dict(ckpt["g"], strict=False)
File "/home/jirib/anaconda3/envs/pytorch/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1482, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Generator:
size mismatch for to_rgbs.5.conv.weight: copying a param with shape torch.Size([3, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 32, 1, 1]).
`
Hello, i modified the generator and discriminator, then trained the model (Was trying something out). When i then go on to load the model, this error message pops out

@TheGullahanMaster
Copy link
Author

TheGullahanMaster commented May 4, 2022

nevermind, it works now, loaded a checkpoint saved before those changes on accident

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant