Hello,I am tring to build a CNN network,and I want to make a resnet50 which is deleted last fc layer to be my network’s backbone. Then I want to save a model file of resnet50 which is deleted last fc layer.so I can use “my_network.resnet.load_state_dict(torch.load(resnet50_reduce_fclayer.pth))”.
I have used modules.children() to do

微信截图_20190720110412.png711×150 8.95 KB

But when my_network.resnet.load_state_dict(torch.load(resnet_reduce_fc.pth)),it will show error:

key.png1473×167 16.1 KB

who can tell me how to deal this problem, thank you!