zylo117 / Yet-Another-EfficientDet-Pytorch

The pytorch re-implement of the official efficientdet with SOTA performance in real time and pretrained weights.
GNU Lesser General Public License v3.0
5.2k stars 1.27k forks source link

Bug in weight initialization #722

Open radulescupetru opened 2 years ago

radulescupetru commented 2 years ago

Hey, init_weights method in utils/utils.py has a bug `def init_weights(model): for name, module in model.named_modules(): is_conv_layer = isinstance(module, nn.Conv2d)

    if is_conv_layer:
        if "conv_list" or "header" in name:
            variance_scaling_(module.weight.data)
        else:
            nn.init.kaiming_uniform_(module.weight.data)

if "conv_list" or "header" in name:is always going to be True as it will basically check the length of the 'conv_list' string which is always greater than 0. The check should beif "conv_list" in name or "header" in name:`