When I use model.load_state_dict(pretrained_model, strict=False)to load your model,the error occurs.Then I find that the pretrained_model from pretrained_model=gcv.models.resnet101(pretrained=True) is a class gluoncvth.models.resnet.ResNet,not a dict.It also can't use pretrained_model.items() or .state.dict() to change the layers in pretrained_model.
How can I deal with these problems ?Please give me a hand.
When I use
model.load_state_dict(pretrained_model, strict=False)
to load your model,the error occurs.Then I find that the pretrained_model frompretrained_model=gcv.models.resnet101(pretrained=True)
is a classgluoncvth.models.resnet.ResNet
,not a dict.It also can't usepretrained_model.items()
or.state.dict()
to change the layers inpretrained_model.
How can I deal with these problems ?Please give me a hand.