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

The pretrain cifar10 resnet110 indeed is resnet164 (BottleNeck)

Open jiangyangzhou opened this issue 6 years ago • 1 comments

I found the pretrain cifar10 model resnet110 is not resnet110, but resnet164. The model is: model = resnet(depth = 164, block_name='bottleNeck') Use this model can load the state_dict sucessfully, but I haven't check the accuracy. btw, the state_dict contain 'module', we can load the state_dict like this:

def load_parallel_weight(model, weight):
    state_dict = torch.load(weight)['state_dict']
    new_dict={}
    for w in state_dict:
        new_dict['.'.join(filter(lambda x:x!="module", w.split('.')))] = state_dict[w]
    model.load_state_dict(new_dict)

jiangyangzhou avatar Aug 24 '19 05:08 jiangyangzhou

ahha, that's why the dictionary keys don't match. could you please upload the pre-trained model for resnet 110 with block_name='basicblock'?

jiaqian avatar Oct 23 '19 09:10 jiaqian