Skip to content

求帮助改进 #177

@CX520-afx

Description

@CX520-afx

Loading checkpoint from expr/checkpoints/celeba_hq\100000_nets_ema.ckpt...
Traceback (most recent call last):
File "D:\QQQ\stargan-v2-master\main.py", line 182, in
main(args)
File "D:\QQQ\stargan-v2-master\main.py", line 73, in main
solver.sample(loaders)
File "D:\pycharm\python_study\pythonProject1\Graduate.venv\Lib\site-packages\torch\utils_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "D:\QQQ\stargan-v2-master\core\solver.py", line 178, in sample
self._load_checkpoint(args.resume_iter)
File "D:\QQQ\stargan-v2-master\core\solver.py", line 73, in _load_checkpoint
ckptio.load(step)
File "D:\QQQ\stargan-v2-master\core\checkpoint.py", line 48, in load
module.module.load_state_dict(module_dict[name])
File "D:\pycharm\python_study\pythonProject1\Graduate.venv\Lib\site-packages\torch\nn\modules\module.py", line 2581, in load_state_dict
raise RuntimeError(
RuntimeError: Error(s) in loading state_dict for Generator:
Missing key(s) in state_dict: "decode.3.conv1x1.weight".
Unexpected key(s) in state_dict: "encode.6.conv1.weight", "encode.6.conv1.bias", "encode.6.conv2.weight", "encode.6.conv2.bias", "encode.6.norm1.weight", "encode.6.norm1.bias", "encode.6.norm2.weight", "encode.6.norm2.bias", "decode.6.conv1.weight", "decode.6.conv1.bias", "decode.6.conv2.weight", "decode.6.conv2.bias", "decode.6.norm1.fc.weight", "decode.6.norm1.fc.bias", "decode.6.norm2.fc.weight", "decode.6.norm2.fc.bias", "decode.6.conv1x1.weight".
size mismatch for decode.3.conv1.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 512, 3, 3]).
size mismatch for decode.3.conv1.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for decode.3.conv2.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 256, 3, 3]).
size mismatch for decode.3.conv2.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for decode.3.norm2.fc.weight: copying a param with shape torch.Size([1024, 64]) from checkpoint, the shape in current model is torch.Size([512, 64]).
size mismatch for decode.3.norm2.fc.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for decode.4.conv1.weight: copying a param with shape torch.Size([256, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 256, 3, 3]).
size mismatch for decode.4.conv1.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for decode.4.conv2.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 128, 3, 3]).
size mismatch for decode.4.conv2.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for decode.4.norm1.fc.weight: copying a param with shape torch.Size([1024, 64]) from checkpoint, the shape in current model is torch.Size([512, 64]).
size mismatch for decode.4.norm1.fc.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for decode.4.norm2.fc.weight: copying a param with shape torch.Size([512, 64]) from checkpoint, the shape in current model is torch.Size([256, 64]).
size mismatch for decode.4.norm2.fc.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for decode.4.conv1x1.weight: copying a param with shape torch.Size([256, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([128, 256, 1, 1]).
size mismatch for decode.5.conv1.weight: copying a param with shape torch.Size([128, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 128, 3, 3]).
size mismatch for decode.5.conv1.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for decode.5.conv2.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 64, 3, 3]).
size mismatch for decode.5.conv2.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for decode.5.norm1.fc.weight: copying a param with shape torch.Size([512, 64]) from checkpoint, the shape in current model is torch.Size([256, 64]).
size mismatch for decode.5.norm1.fc.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for decode.5.norm2.fc.weight: copying a param with shape torch.Size([256, 64]) from checkpoint, the shape in current model is torch.Size([128, 64]).
size mismatch for decode.5.norm2.fc.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for decode.5.conv1x1.weight: copying a param with shape torch.Size([128, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([64, 128, 1, 1]).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions