3D-ResNets-PyTorch icon indicating copy to clipboard operation
3D-ResNets-PyTorch copied to clipboard

Transfer learning load model resnext-101-64f-kinetics.pth

Open priyanka-chaudhary opened this issue 5 years ago • 1 comments

@kenshohara : I couldn't find any note for using the model weights for transfer learning Hi, I am trying to use the "resnext-101-64f-kinetics.pth" for transfer learning on my custom dataset. In the script "model.py", model.load_state_dict(pretrain['state_dict']) Line 173 is causing run-time error due to mismatch in num_classes. In my dataset I have 4 classes and I changed accordingly in the main, model etc files. But I am getting this error: RuntimeError: Error(s) in loading state_dict for DataParallel: size mismatch for module.fc.weight: copying a param with shape torch.Size([400, 2048]) from checkpoint, the shape in current model is torch.Size([4, 2048]). size mismatch for module.fc.bias: copying a param with shape torch.Size([400]) from checkpoint, the shape in current model is torch.Size([4]).

Can anybody guide me how to do that?

Thanks in advance.

priyanka-chaudhary avatar Dec 03 '19 13:12 priyanka-chaudhary

Hello, Do you have any ideas to solve this problem ?

gmt710 avatar Jan 04 '21 04:01 gmt710