Skip to content

Multi pretrained weights: Cleanups and Refactoring #4652

Closed
@jdsgomes

Description

@jdsgomes

Candidates:

  • Reduce code duplication on model builders by refactoring. For example potentially push the weigh loading mechanism in the private builder methods currently inherited from torchvision.models. Also we could provide a pretrained deprecation method.
  • Review recipe links and ensure they are accurate for all Community Contributed models. Check if possible for some of them to remap their training process to our current ref scripts.
  • Decide how quantized models will link to their unquantized versions.
  • Naming conventions:
    • The name of the Weights base Enum class and the naming convention of the inheriting classes. Also make sure that all classes are aligned with the model builder names. How are we going to handle _ in names (for example on inception_v3 and the resnext models)?
    • The name of the WeightEntry data class.
    • The name of Weights.verify() method (because it does more than just verification).
    • The names of the enum values; also their styles (all capital?). Example: ImageNet1K_RefV1
    • Currently the _RefV1 of one model doesn't have to be _RefV1 of another model. For example ResNet vs RegNets use different recipes with the same enum value. In other cases, we skip _RefV1 and go directly to _RefV2, for example the WideResNet50 weights. Is this a problem?
  • Decide the signature of models._api.get_weight() and make it public. Ensure it's torchhub-friendly.

cc @datumbox @pmeier @bjuncek @NicolasHug

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions