facebookresearch / swav

PyTorch implementation of SwAV https//arxiv.org/abs/2006.09882
Other
2.01k stars 280 forks source link

load_state_dict() got an unexpected keyword argument 'strict' #75

Open Hfhstrive opened 3 years ago

Hfhstrive commented 3 years ago

Hello, I have a question to ask you. The following error occurs when I run the eval_semisup.py file:

Line145 in util.py: msg = value.load_state_dict(checkpoint[key],strict=False) TypeError: load_state_dict() got an unexpected keyword argument 'strict' During handling of the above exception, another exception occurred:

May I ask how to solve it? Thanks again for the code you provided.

mathildecaron31 commented 3 years ago

Hi @Hfhstrive

What other exception occurred ?

Hfhstrive commented 3 years ago

@mathildecaron31 Thank you for your reply! Update the problem:

Line 140 in util.py: msg = value.load_state_dict(checkpoint[key],strict=False) TypeError: load_state_dict() got an unexpected keyword argument 'strict'

During handling of the above exception, another exception occurred: Line 140 in util.py: msg = value.load_state_dict(checkpoint[key],strict=False) ValueError: loaded state dict has a different number of parameter groups