facebookresearch/swav

load_state_dict() got an unexpected keyword argument 'strict'

Hfhstrive opened this issue · 2 comments

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.

Hi @Hfhstrive

What other exception occurred ?

@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