Thanks for this answer, and just trying to riff on this reply.
Here we load a model with 1 class, and the backbone is pretrained
model = gluoncv.model_zoo.DeepLabV3(nclass=1,backbone=‘resnet152’, pretrained_base=True)
Here we load the same model, but it has 21 classes instead, and the backbone, and onwards are all pretrained
p_model = gluoncv.model_zoo.get_deeplab(dataset=‘coco’, backbone=‘resnet152’, pretrained=True)
model.features = p_model.features
Throws the following error
AttributeError: ‘DeepLabV3’ object has no attribute ‘features’
Do you know what would be going wrong here?
Edit: The reason I want to do this, is I want everything after the backbone to be pretrained also, up to but not including the last layer, of course.