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

[BUG] misunderstanding in create_model_from_config for arg pretrained #168

Closed
yohann84L opened this issue Jan 14, 2021 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@yohann84L
Copy link

yohann84L commented Jan 14, 2021

This may not be a bug/error but in create_model_from_config you have the following:

pretrained_backbone = kwargs.pop('pretrained_backbone', True)
if pretrained or checkpoint_path:
    pretrained_backbone = False  # no point in loading backbone weights

If pretrained is True in create_model_from_config , this lead to not loading pretrained weight for the backbone in the EfficientDet class:

class EfficientDet(nn.Module):
    def __init__(self, config, pretrained_backbone=True, alternate_init=False):
        super(EfficientDet, self).__init__()
        self.config = config
        set_config_readonly(self.config)
        self.backbone = create_model(
            config.backbone_name, features_only=True, out_indices=(2, 3, 4),
            pretrained=pretrained_backbone, **config.backbone_args)

Is there an explanation or it should be changed to the following ?

pretrained_backbone = kwargs.pop('pretrained_backbone', True)
if not pretrained or checkpoint_path:
    pretrained_backbone = False  # no point in loading backbone weights
@yohann84L yohann84L added the bug Something isn't working label Jan 14, 2021
@yohann84L
Copy link
Author

Okay sorry, forgot what I said, pretrained is actually for the whole EfficientDet model and not the backbone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant