def init_weights(self, pretrained=None):
    'Initialize the weights in backbone.\n\n        Args:\n            pretrained (str, optional): Path to pre-trained weights.\n                Defaults to None.\n        '
    if isinstance(pretrained, str):
        logger = get_root_logger()
        load_checkpoint(self, pretrained, strict=False, logger=logger)
    elif (pretrained is None):
        for m in self.modules():
            if isinstance(m, nn.Conv2d):
                kaiming_init(m)
            elif isinstance(m, (_BatchNorm, nn.GroupNorm)):
                constant_init(m, 1)
        if (self.dcn is not None):
            for m in self.modules():
                if isinstance(m, Bottle2neck):
                    for n in m.convs:
                        if hasattr(n, 'conv_offset'):
                            constant_init(n.conv_offset, 0)
        if self.zero_init_residual:
            for m in self.modules():
                if isinstance(m, Bottle2neck):
                    constant_init(m.norm3, 0)
    else:
        raise TypeError('pretrained must be a str or None')
Initialize the weights in backbone.

Args:
    pretrained (str, optional): Path to pre-trained weights.
        Defaults to None.
def init_weights(self, pretrained=None):
    'Initialize the weights in backbone.\n\n        Args:\n            pretrained (str, optional): Path to pre-trained weights.\n                Defaults to None.\n        '
    if isinstance(pretrained, str):
        logger = get_root_logger()
        load_checkpoint(self, pretrained, strict=False, logger=logger)
    elif (pretrained is None):
        for m in self.modules():
            if isinstance(m, nn.Conv2d):
                kaiming_init(m)
            elif isinstance(m, (_BatchNorm, nn.GroupNorm)):
                constant_init(m, 1)
        if (self.dcn is not None):
            for m in self.modules():
                if isinstance(m, Bottle2neck):
                    for n in m.convs:
                        if hasattr(n, 'conv_offset'):
                            constant_init(n.conv_offset, 0)
        if self.zero_init_residual:
            for m in self.modules():
                if isinstance(m, Bottle2neck):
                    constant_init(m.norm3, 0)
    else:
        raise TypeError('pretrained must be a str or None')