Skip to content

The definition of UNet in model.py is inconsistent with the training file rescontruction.pkl you provided #6

@wudami

Description

@wudami

The definition of UNet in model.py is inconsistent with the training file rescontruction.pkl you provided.

key.txt
Traceback (most recent call last):
File "/home/ltsyl308/soft/pycharm/pycharm-community-2022.3/plugins/python-ce/helpers/pydev/pydevd.py", line 1496, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/ltsyl308/soft/pycharm/pycharm-community-2022.3/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/ltsyl308/wulimin/TRIS-main/ImageReconstruction/test.py", line 106, in
netG.load_state_dict(checkpoint)
File "/home/ltsyl308/anaconda3/envs/TRIS/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1224, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for UNet:
Missing key(s) in state_dict: "inc.double_conv.0.weight", "inc.double_conv.2.weight".
Unexpected key(s) in state_dict: "stem.0.weight", "cells.0.preprocess0.op.1.weight", "cells.0.preprocess1.op.1.weight", "cells.0._ops.0.op.1.weight", "cells.0._ops.0.op.2.weight", "cells.0._ops.1.op.1.weight", "cells.0._ops.1.op.2.weight", "cells.0._ops.2.op.1.weight", "cells.0._ops.2.op.2.weight", "cells.0._ops.2.op.4.weight", "cells.0._ops.2.op.5.weight", "cells.0._ops.3.op.1.weight", "cells.0._ops.3.op.2.weight", "cells.0._ops.4.op.1.weight", "cells.0._ops.4.op.2.weight", "cells.0._ops.5.op.1.weight", "cells.0._ops.5.op.2.weight", "cells.0._ops.7.op.1.weight", "cells.0._ops.7.op.2.weight", "cells.0._ops.7.op.4.weight", "cells.0._ops.7.op.5.weight".
Backend TkAgg is interactive backend. Turning interactive mode on.

进程已结束,退出代码1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions