Skip to content

Commit

Permalink
Fix get_model (#1626)
Browse files Browse the repository at this point in the history
* fix get model bug

* disable dp
  • Loading branch information
bryanyzhu authored Mar 2, 2021
1 parent 22bde35 commit 3862e2d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
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)

0 comments on commit 3862e2d

Please sign in to comment.