nasnet-pytorch icon indicating copy to clipboard operation
nasnet-pytorch copied to clipboard

error while loading pretrained weights

Open sinAshish opened this issue 6 years ago • 2 comments

I get this error while loading the weights:

RuntimeError                              Traceback (most recent call last)
<ipython-input-32-d82b0689f3c8> in <module>()
----> 1 model=model.load_state_dict(weights)

/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict)
    767         if len(error_msgs) > 0:
    768             raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
--> 769                                self.__class__.__name__, "\n\t".join(error_msgs)))
    770 
    771     def _named_members(self, get_members_fn, prefix='', recurse=True):

RuntimeError: Error(s) in loading state_dict for NASNet:
	Missing key(s) in state_dict: "aux_features.2.weight", "aux_features.3.weight", "aux_features.3.bias", "aux_features.3.running_mean", "aux_features.3.running_var", "aux_features.5.weight", "aux_features.6.weight", "aux_features.6.bias", "aux_features.6.running_mean", "aux_features.6.running_var", "aux_linear.weight", "aux_linear.bias". 

sinAshish avatar May 26 '19 11:05 sinAshish

@sinAshish Please set strict=False when loading state dict as I didn't include parameters of aux_features in the provided checkpoints.

wandering007 avatar May 27 '19 06:05 wandering007

Ok i'll try

sinAshish avatar May 27 '19 10:05 sinAshish