d-li14/mobilenetv2.pytorch

Load the trained model and report an error when testing separately

liuge1008 opened this issue · 0 comments

When I use your following code to load the model:
source_state = torch.load(args.weight)
target_state = OrderedDict()
for k, v in source_state.items():
if k[:7] != 'module.':
k = 'module.' + k
target_state[k] = v
model.load_state_dict(target_state)

Report an error:
2021-05-30 15-27-50屏幕截图