Skip to content

Add weight for mnasnet0_75 and mnasnet1_3 #6019

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

Merged
merged 6 commits into from
May 16, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions torchvision/models/mnasnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,20 @@ class MNASNet0_5_Weights(WeightsEnum):


class MNASNet0_75_Weights(WeightsEnum):
# If a default model is added here the corresponding changes need to be done in mnasnet0_75
pass
IMAGENET1K_V1 = Weights(
url="https://download.pytorch.org/models/mnasnet0_75-7090bc5f.pth",
transforms=partial(ImageClassification, crop_size=224, resize_size=232),
meta={
**_COMMON_META,
"recipe": "https://github.com/pytorch/vision/pull/6019",
"num_params": 3170208,
"metrics": {
"acc@1": 71.180,
"acc@5": 90.496,
},
},
)
DEFAULT = IMAGENET1K_V1


class MNASNet1_0_Weights(WeightsEnum):
Expand All @@ -256,8 +268,20 @@ class MNASNet1_0_Weights(WeightsEnum):


class MNASNet1_3_Weights(WeightsEnum):
# If a default model is added here the corresponding changes need to be done in mnasnet1_3
pass
IMAGENET1K_V1 = Weights(
url="https://download.pytorch.org/models/mnasnet1_3-a4c69d6f.pth",
transforms=partial(ImageClassification, crop_size=224, resize_size=232),
meta={
**_COMMON_META,
"recipe": "https://github.com/pytorch/vision/pull/6019",
"num_params": 6282256,
"metrics": {
"acc@1": 76.506,
"acc@5": 93.522,
},
},
)
DEFAULT = IMAGENET1K_V1


def _mnasnet(alpha: float, weights: Optional[WeightsEnum], progress: bool, **kwargs: Any) -> MNASNet:
Expand Down