StacyYang / gluoncv-torch

PyTorch API for GluonCV Models
MIT License
536 stars 62 forks source link

AttributeError: 'ResNet' object has no attribute 'copy' #22

Open yaodonggggggg opened 5 years ago

yaodonggggggg commented 5 years ago

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.

bloodraven66 commented 4 years ago

Did you figure out how to do it? I am facing the same issue.

misty-rain-q commented 4 years ago

I am also facing the same issue.

ShantiRoseCodes commented 1 year ago

I am also facing the same issue

dreamcatcher-zgr commented 1 year ago

you can try model = torch.load(pretrained_model)