-
Notifications
You must be signed in to change notification settings - Fork 5
Description
您好,感谢您开源您的工作,我对该工作非常感兴趣!
但是我在训练完成后,在测试时出现加载模型不匹配的问题,请问这是什么原因?
Traceback (most recent call last):
File "test.py", line 114, in
test()
File "test.py", line 52, in test
net.load_state_dict(torch.load(opt.pth_dir, map_location=device)['state_dict'])
File "C:\Users\Yang.conda\envs\seg\lib\site-packages\torch\nn\modules\module.py", line 1667, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Net:
Unexpected key(s) in state_dict: "model.stem.0.weight", "model.stem.0.bias", "model.stem.0.running_mean", "model.stem.0.running_var", "model.stem.0.num_batches_tracked", "model.stem.1.weight", "model.stem.2.weight", "model.stem.2.bias", "model.stem.2.running_mean",
"model.stem.2.running_var", "model.stem.2.num_batches_tracked", "model.stem.4.weight", "model.stem.5.weight"