You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
size mismatch for classifier_swap.weight: copying a param of torch.Size([12, 2048]) from checkpoint, where the shape is torch.Size([2, 2048]) in current model.
#69
Open
rnlee1998 opened this issue
Apr 24, 2021
· 0 comments
when I run the test.py, I got the error. How can I solve it ?
Namespace(acc_report=True, auto_resume=True, backbone='resnet50', batch_size=4, crop_resolution=448, dataset='SHIP', num_workers=0, resize_resolution=512, resume=None, save_suffix=None, swap_num=[7, 7], version='test')
_42315_SHIP
load from ./net_model_42315_SHIP\weights_0_1026_0.9977_0.9977.pth ...
Traceback (most recent call last):
File "e:/graduation_project/DCL-master/test.py", line 125, in
model.load_state_dict(model_dict)
File "E:\software\anaconda\envs\DCL\lib\site-packages\torch\nn\modules\module.py", line 719, in load_state_dict
self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for MainModel:
size mismatch for classifier_swap.weight: copying a param of torch.Size([12, 2048]) from checkpoint, where the shape is torch.Size([2, 2048]) in current model.
The text was updated successfully, but these errors were encountered:
when I run the test.py, I got the error. How can I solve it ?
Namespace(acc_report=True, auto_resume=True, backbone='resnet50', batch_size=4, crop_resolution=448, dataset='SHIP', num_workers=0, resize_resolution=512, resume=None, save_suffix=None, swap_num=[7, 7], version='test')
_42315_SHIP
load from ./net_model_42315_SHIP\weights_0_1026_0.9977_0.9977.pth ...
Traceback (most recent call last):
File "e:/graduation_project/DCL-master/test.py", line 125, in
model.load_state_dict(model_dict)
File "E:\software\anaconda\envs\DCL\lib\site-packages\torch\nn\modules\module.py", line 719, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for MainModel:
size mismatch for classifier_swap.weight: copying a param of torch.Size([12, 2048]) from checkpoint, where the shape is torch.Size([2, 2048]) in current model.
The text was updated successfully, but these errors were encountered: