Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deeplab V3+ model doesn't support ResNet-50 as backbone? #161

Open
panovr opened this issue Mar 20, 2024 · 0 comments
Open

Deeplab V3+ model doesn't support ResNet-50 as backbone? #161

panovr opened this issue Mar 20, 2024 · 0 comments

Comments

@panovr
Copy link

panovr commented Mar 20, 2024

When reading the Deeplab V3+ code, I found it seems that current Deeplab V3+ model doesn't support ResNet-50 as backbone, and it only support ResNet-101 as backbone.

class DeepLab(BaseModel):
    def __init__(self, num_classes, in_channels=3, backbone='xception', pretrained=True, 
                output_stride=16, freeze_bn=False, freeze_backbone=False, **_):
                
        super(DeepLab, self).__init__()
        assert ('xception' or 'resnet' in backbone)
        if 'resnet' in backbone:
            self.backbone = ResNet(in_channels=in_channels, output_stride=output_stride, pretrained=pretrained)
            low_level_channels = 256
class ResNet(nn.Module):
    def __init__(self, in_channels=3, output_stride=16, backbone='resnet101', pretrained=True):
        super(ResNet, self).__init__()
        model = getattr(models, backbone)(pretrained)

You can see when DeepLab class create ResNet as backbone, it doesn't pass backbone parameter.

@panovr panovr changed the title Deeplab V3+ model doesn't support ResNet-50? Deeplab V3+ model doesn't support ResNet-50 as backbone? Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant