Skip to content

Fix get_model #1626

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 2 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions gluoncv/model_zoo/danet.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ def __init__(self, in_channels, out_channels, norm_layer=nn.BatchNorm, norm_kwar
self.conv52.add(nn.Activation('relu'))

self.conv6 = nn.HybridSequential()
self.conv6.add(nn.Dropout(0.1))
# self.conv6.add(nn.Dropout(0.1))
self.conv6.add(nn.Conv2D(in_channels=512, channels=out_channels, kernel_size=1))

self.conv7 = nn.HybridSequential()
self.conv7.add(nn.Dropout(0.1))
# self.conv7.add(nn.Dropout(0.1))
self.conv7.add(nn.Conv2D(in_channels=512, channels=out_channels, kernel_size=1))

self.conv8 = nn.HybridSequential()
self.conv8.add(nn.Dropout(0.1))
# self.conv8.add(nn.Dropout(0.1))
self.conv8.add(nn.Conv2D(in_channels=512, channels=out_channels, kernel_size=1))

def hybrid_forward(self, F, x):
Expand Down
2 changes: 1 addition & 1 deletion gluoncv/model_zoo/model_zoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
'resnext50_32x4d': resnext50_32x4d,
'resnext101_32x4d': resnext101_32x4d,
'resnext101_64x4d': resnext101_64x4d,
'resnext101b_64x4d': resnext101e_64x4d,
'resnext101e_64x4d': resnext101e_64x4d,
'se_resnext50_32x4d': se_resnext50_32x4d,
'se_resnext101_32x4d': se_resnext101_32x4d,
'se_resnext101_64x4d': se_resnext101_64x4d,
Expand Down
8 changes: 8 additions & 0 deletions gluoncv/model_zoo/resnext.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ def resnext101_64x4d(**kwargs):


def resnext101e_64x4d(**kwargs):
# pylint: disable=line-too-long
r"""ResNext101e 64x4d model modified from
`"Aggregated Residual Transformations for Deep Neural Network"
<http://arxiv.org/abs/1611.05431>`_ paper.
Expand All @@ -388,6 +389,9 @@ def resnext101e_64x4d(**kwargs):
for :class:`mxnet.gluon.contrib.nn.SyncBatchNorm`.
"""
kwargs['use_se'] = False
if kwargs['pretrained']:
msg = 'GluonCV does not have pretrained weights for resnext101e_64x4d at this moment. Please set pretrained=False.'
raise RuntimeError(msg)
return get_resnext(101, 64, 4, deep_stem=True, avg_down=True, **kwargs)


Expand Down Expand Up @@ -479,6 +483,7 @@ def se_resnext101_64x4d(**kwargs):


def se_resnext101e_64x4d(**kwargs):
# pylint: disable=line-too-long
r"""SE-ResNext101e 64x4d model modified from
`"Aggregated Residual Transformations for Deep Neural Network"
<http://arxiv.org/abs/1611.05431>`_ paper.
Expand All @@ -504,4 +509,7 @@ def se_resnext101e_64x4d(**kwargs):
for :class:`mxnet.gluon.contrib.nn.SyncBatchNorm`.
"""
kwargs['use_se'] = True
if kwargs['pretrained']:
msg = 'GluonCV does not have pretrained weights for resnext101e_64x4d at this moment. Please set pretrained=False.'
raise RuntimeError(msg)
return get_resnext(101, 64, 4, deep_stem=True, avg_down=True, **kwargs)