3D-ResNets-PyTorch
3D-ResNets-PyTorch copied to clipboard
Transfer learning load model resnext-101-64f-kinetics.pth
@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.
Hello, Do you have any ideas to solve this problem ?