Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
distiller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
distiller
Commits
8a272306
Commit
8a272306
authored
5 years ago
by
Guy Jacob
Browse files
Options
Downloads
Patches
Plain Diff
Add support for wide-resnet models that exist in torchvision
parent
10cd1a85
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
distiller/models/__init__.py
+1
-1
1 addition, 1 deletion
distiller/models/__init__.py
distiller/models/imagenet/resnet.py
+24
-0
24 additions, 0 deletions
distiller/models/imagenet/resnet.py
with
25 additions
and
1 deletion
distiller/models/__init__.py
+
1
−
1
View file @
8a272306
...
...
@@ -39,7 +39,7 @@ SUPPORTED_DATASETS = ('imagenet', 'cifar10', 'mnist')
# ResNet special treatment: we have our own version of ResNet, so we need to over-ride
# TorchVision's version.
RESNET_SYMS
=
(
'
ResNet
'
,
'
resnet18
'
,
'
resnet34
'
,
'
resnet50
'
,
'
resnet101
'
,
'
resnet152
'
,
'
resnext50_32x4d
'
,
'
resnext101_32x8d
'
)
'
resnext50_32x4d
'
,
'
resnext101_32x8d
'
,
'
wide_resnet50_2
'
,
'
wide_resnet101_2
'
)
TORCHVISION_MODEL_NAMES
=
sorted
(
name
for
name
in
torch_models
.
__dict__
...
...
This diff is collapsed.
Click to expand it.
distiller/models/imagenet/resnet.py
+
24
−
0
View file @
8a272306
...
...
@@ -32,6 +32,7 @@ from distiller.modules import EltwiseAdd
__all__
=
[
'
ResNet
'
,
'
resnet18
'
,
'
resnet34
'
,
'
resnet50
'
,
'
resnet101
'
,
'
resnet152
'
,
'
resnext50_32x4d
'
,
'
resnext101_32x8d
'
,
'
wide_resnet50_2
'
,
'
wide_resnet101_2
'
,
'
DistillerBottleneck
'
]
...
...
@@ -208,3 +209,26 @@ def resnext101_32x8d(pretrained=False, progress=True, **kwargs):
kwargs
[
'
width_per_group
'
]
=
8
return
_resnet
(
'
resnext101_32x8d
'
,
DistillerBottleneck
,
[
3
,
4
,
23
,
3
],
pretrained
,
progress
,
**
kwargs
)
def
wide_resnet50_2
(
pretrained
=
False
,
progress
=
True
,
**
kwargs
):
"""
Constructs a Wide ResNet-50-2 model.
Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
progress (bool): If True, displays a progress bar of the download to stderr
"""
kwargs
[
'
width_per_group
'
]
=
64
*
2
return
_resnet
(
'
wide_resnet50_2
'
,
DistillerBottleneck
,
[
3
,
4
,
6
,
3
],
pretrained
,
progress
,
**
kwargs
)
def
wide_resnet101_2
(
pretrained
=
False
,
progress
=
True
,
**
kwargs
):
"""
Constructs a Wide ResNet-101-2 model.
Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
progress (bool): If True, displays a progress bar of the download to stderr
"""
kwargs
[
'
width_per_group
'
]
=
64
*
2
return
_resnet
(
'
wide_resnet101_2
'
,
DistillerBottleneck
,
[
3
,
4
,
23
,
3
],
pretrained
,
progress
,
**
kwargs
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment