Skip to content

我复现的时候出现这个问题,怎么解决 #13

@YaangHailong

Description

@YaangHailong

好像是模型不一致问题

python train_test.py --test=True
Starting test.
Traceback (most recent call last):
File "/home/manbo/yhl/UGRAN-master/train_test.py", line 40, in
test(args=args)
File "/home/manbo/yhl/UGRAN-master/test.py", line 63, in test
model.load_state_dict(torch.load(args.save_model+args.method+'.pth'))
File "/home/manbo/anaconda3/envs/yhlUGRAN/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1497, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for UGRAN:
Missing key(s) in state_dict: "decoder.context5.proj.0.conv.weight", "decoder.context5.proj.0.bn.weight", "decoder.context5.proj.0.bn.bias", "decoder.context5.proj.0.bn.running_mean", "decoder.context5.proj.0.bn.running_var", "decoder.context5.proj.1.conv.weight", "decoder.context5.proj.1.bn.weight", "decoder.context5.proj.1.bn.bias", "decoder.context5.proj.1.bn.running_mean", "decoder.context5.proj.1.bn.running_var", "decoder.context4.interact1.0.conv.weight", "decoder.context4.interact1.0.bn.weight", "decoder.context4.interact1.0.bn.bias", "decoder.context4.interact1.0.bn.running_mean", "decoder.context4.interact1.0.bn.running_var", "decoder.context4.interact1.1.conv.weight", "decoder.context4.interact1.1.bn.weight", "decoder.context4.interact1.1.bn.bias", "decoder.context4.interact1.1.bn.running_mean", "decoder.context4.interact1.1.bn.running_var", "decoder.context4.proj.0.conv.weight", "decoder.context4.proj.0.bn.weight", "decoder.context4.proj.0.bn.bias", "decoder.context4.proj.0.bn.running_mean", "decoder.context4.proj.0.bn.running_var", "decoder.context4.proj.1.conv.weight", "decoder.context4.proj.1.bn.weight", "decoder.context4.proj.1.bn.bias", "decoder.context4.proj.1.bn.running_mean", "decoder.context4.proj.1.bn.running_var", "decoder.context3.interact1.0.conv.weight", "decoder.context3.interact1.0.bn.weight", "decoder.context3.interact1.0.bn.bias", "decoder.context3.interact1.0.bn.running_mean", "decoder.context3.interact1.0.bn.running_var", "decoder.context3.interact1.1.conv.weight", "decoder.context3.interact1.1.bn.weight", "decoder.context3.interact1.1.bn.bias", "decoder.context3.interact1.1.bn.running_mean", "decoder.context3.interact1.1.bn.running_var", "decoder.context3.interact2.0.conv.weight", "decoder.context3.interact2.0.bn.weight", "decoder.context3.interact2.0.bn.bias", "decoder.context3.interact2.0.bn.running_mean", "decoder.context3.interact2.0.bn.running_var", "decoder.context3.interact2.1.conv.weight", "decoder.context3.interact2.1.bn.weight", "decoder.context3.interact2.1.bn.bias", "decoder.context3.interact2.1.bn.running_mean", "decoder.context3.interact2.1.bn.running_var", "decoder.context3.proj.0.conv.weight", "decoder.context3.proj.0.bn.weight", "decoder.context3.proj.0.bn.bias", "decoder.context3.proj.0.bn.running_mean", "decoder.context3.proj.0.bn.running_var", "decoder.context3.proj.1.conv.weight", "decoder.context3.proj.1.bn.weight", "decoder.context3.proj.1.bn.bias", "decoder.context3.proj.1.bn.running_mean", "decoder.context3.proj.1.bn.running_var", "decoder.context2.interact1.0.conv.weight", "decoder.context2.interact1.0.bn.weight", "decoder.context2.interact1.0.bn.bias", "decoder.context2.interact1.0.bn.running_mean", "decoder.context2.interact1.0.bn.running_var", "decoder.context2.interact1.1.conv.weight", "decoder.context2.interact1.1.bn.weight", "decoder.context2.interact1.1.bn.bias", "decoder.context2.interact1.1.bn.running_mean", "decoder.context2.interact1.1.bn.running_var", "decoder.context2.interact2.0.conv.weight", "decoder.context2.interact2.0.bn.weight", "decoder.context2.interact2.0.bn.bias", "decoder.context2.interact2.0.bn.running_mean", "decoder.context2.interact2.0.bn.running_var", "decoder.context2.interact2.1.conv.weight", "decoder.context2.interact2.1.bn.weight", "decoder.context2.interact2.1.bn.bias", "decoder.context2.interact2.1.bn.running_mean", "decoder.context2.interact2.1.bn.running_var", "decoder.context2.proj.0.conv.weight", "decoder.context2.proj.0.bn.weight", "decoder.context2.proj.0.bn.bias", "decoder.context2.proj.0.bn.running_mean", "decoder.context2.proj.0.bn.running_var", "decoder.context2.proj.1.conv.weight", "decoder.context2.proj.1.bn.weight", "decoder.context2.proj.1.bn.bias", "decoder.context2.proj.1.bn.running_mean", "decoder.context2.proj.1.bn.running_var", "decoder.fusion4.res.conv.weight", "decoder.fusion4.res.bn.weight", "decoder.fusion4.res.bn.bias", "decoder.fusion4.res.bn.running_mean", "decoder.fusion4.res.bn.running_var", "decoder.fusion3.res.conv.weight", "decoder.fusion3.res.bn.weight", "decoder.fusion3.res.bn.bias", "decoder.fusion3.res.bn.running_mean", "decoder.fusion3.res.bn.running_var", "decoder.fusion2.res.conv.weight", "decoder.fusion2.res.bn.weight", "decoder.fusion2.res.bn.bias", "decoder.fusion2.res.bn.running_mean", "decoder.fusion2.res.bn.running_var".
Unexpected key(s) in state_dict: "decoder.context5.proj.conv.weight", "decoder.context5.proj.bn.weight", "decoder.context5.proj.bn.bias", "decoder.context5.proj.bn.running_mean", "decoder.context5.proj.bn.running_var", "decoder.context5.proj.bn.num_batches_tracked", "decoder.context4.interact1.q1.weight", "decoder.context4.interact1.proj.weight", "decoder.context4.interact1.proj.bias", "decoder.context4.interact1.k2.weight", "decoder.context4.interact1.v2.weight", "decoder.context4.proj.conv.weight", "decoder.context4.proj.bn.weight", "decoder.context4.proj.bn.bias", "decoder.context4.proj.bn.running_mean", "decoder.context4.proj.bn.running_var", "decoder.context4.proj.bn.num_batches_tracked", "decoder.context3.interact1.q1.weight", "decoder.context3.interact1.proj.weight", "decoder.context3.interact1.proj.bias", "decoder.context3.interact1.k2.weight", "decoder.context3.interact1.v2.weight", "decoder.context3.interact2.q1.weight", "decoder.context3.interact2.proj.weight", "decoder.context3.interact2.proj.bias", "decoder.context3.interact2.k2.weight", "decoder.context3.interact2.v2.weight", "decoder.context3.proj.conv.weight", "decoder.context3.proj.bn.weight", "decoder.context3.proj.bn.bias", "decoder.context3.proj.bn.running_mean", "decoder.context3.proj.bn.running_var", "decoder.context3.proj.bn.num_batches_tracked", "decoder.context2.interact1.q1.weight", "decoder.context2.interact1.proj.weight", "decoder.context2.interact1.proj.bias", "decoder.context2.interact1.k2.weight", "decoder.context2.interact1.v2.weight", "decoder.context2.interact2.q1.weight", "decoder.context2.interact2.proj.weight", "decoder.context2.interact2.proj.bias", "decoder.context2.interact2.k2.weight", "decoder.context2.interact2.v2.weight", "decoder.context2.proj.conv.weight", "decoder.context2.proj.bn.weight", "decoder.context2.proj.bn.bias", "decoder.context2.proj.bn.running_mean", "decoder.context2.proj.bn.running_var", "decoder.context2.proj.bn.num_batches_tracked".

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