Action-Recognition
Action-Recognition copied to clipboard
size mismatch for output_layers.3.bias: copying a param with shape torch.Size([101]) from checkpoint, the shape in current model is torch.Size([105]).
I get this error when I run test_on_video.py file.
RuntimeError Traceback (most recent call last)
~/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict) 828 if len(error_msgs) > 0: 829 raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( --> 830 self.class.name, "\n\t".join(error_msgs))) 831 return _IncompatibleKeys(missing_keys, unexpected_keys) 832
RuntimeError: Error(s) in loading state_dict for ConvLSTM: size mismatch for output_layers.3.weight: copying a param with shape torch.Size([101, 1024]) from checkpoint, the shape in current model is torch.Size([105, 1024]). size mismatch for output_layers.3.bias: copying a param with shape torch.Size([101]) from checkpoint, the shape in current model is torch.Size([105]).
It's working for me
model.load_state_dict(torch.load(opt.checkpoint_model,map_location=device),strict=False)