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/sg 896 add deprecation for previous breaking changes #1121

Merged

Conversation

shaydeci
Copy link
Collaborator

@shaydeci shaydeci commented Jun 4, 2023

Added deprecations, and backward compatibility to previous breaking changes.

In this PR:

  • InfiniteSampler has been removed, added deprecation using equivalent DistributedSampler.

  • Broken imports
    from super_gradients.training.utils.optimizers.all_optimizers import OPTIMIZERS
    from super_gradients.training.models import BasicBlock, Bottleneck, HpmStruct

  • DDRNetCustom: the init expected a parameter “aux_head” from “arch_params.aux_head”. In the new version of SG, this parameter is: “use_aux_heads=arch_params.use_aux_heads” - added deprecation.

  • BasicDDRBackBone . In old SG version, this block didn’t expect layer3_repeats . Now SG expects it. Also, ddrnet model now assumes that “arch_params” has layer3_repeats parameter. Fixed by setting default=1.

Verified backward compatibility handled outside this PR:

Some were already handled in other PRs, this is the complete list + where they were handled:

  • In ema_params, they had: exp_activation: True. Changed to decay_type: exp handled by @BloodAxe in 69a82bc
  • The architecture custom_stdc name was changed to stdc_custom. Handled by @ofrimasad in 190283e
  • Broken import: from super_gradients.training.models import make_divisible, handled by @BloodAxe in 6b5785d
  • Had: trainer = Trainer(experiment_name=cfg.experiment_name, multi_gpu=cfg.multi_gpu). Changed to use setup_device(() instead - this is the only case where we throw an error, to avoid setting devices inside the Trainer. f50d438
  • Models iinheriting from CustomizableDetector Used to call super().__init__ only with arch_params. Now its changed to accept each parameter separately:
super().__init__(
    backbone=arch_params.backbone,
    heads=arch_params.heads,
    neck=arch_params.neck,
    num_classes=arch_params.num_classes,
    bn_eps=arch_params.bn_eps,
    bn_momentum=arch_params.bn_momentum,
    inplace_act=arch_params.inplace_act
)

handled by @Louis-Dupont in a3618e8

@shaydeci shaydeci marked this pull request as ready for review June 4, 2023 09:16
Copy link
Collaborator

@ofrimasad ofrimasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two minor comments

…revious_breaking_changes' into bug/SG-896_add_deprecation_for_previous_breaking_changes
Copy link
Collaborator

@ofrimasad ofrimasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shaydeci shaydeci merged commit b4eec92 into master Jun 4, 2023
1 check passed
@shaydeci shaydeci deleted the bug/SG-896_add_deprecation_for_previous_breaking_changes branch June 4, 2023 10:22
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

Successfully merging this pull request may close these issues.

None yet

2 participants