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)
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: