EfficientNet-PyTorch icon indicating copy to clipboard operation
EfficientNet-PyTorch copied to clipboard

AttributeError: 'IncompatibleKeys' object has no attribute 'load_state_dict'

Open eborobert opened this issue 5 years ago • 1 comments

Hi I am trying to load a model I just trained to continue training from the last step, however I get the following error:

AttributeError: 'IncompatibleKeys' object has no attribute 'load_state_dict'

This is the command I am using: model = model.load_state_dict(torch.load(f'efficientnet-b0_model_loss_0.18790134154737087.pt'))

Could you please help in this regard

eborobert avatar Dec 07 '19 19:12 eborobert

It seems to be a variable mistake, skip the model = .... it should be looks like this: model.load_state_dict(torch.load(f'efficientnet-b0_model_loss_0.18790134154737087.pt'))

MiguelG97 avatar Oct 08 '21 15:10 MiguelG97