Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
SOLOv2-pytorch
Commits
2bc86fd8
Commit
2bc86fd8
authored
Dec 18, 2018
by
pangjm
Browse files
update resnext
parent
b77b98a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
mmdet/models/backbones/resnet.py
mmdet/models/backbones/resnet.py
+1
-1
mmdet/models/backbones/resnext.py
mmdet/models/backbones/resnext.py
+6
-3
No files found.
mmdet/models/backbones/resnet.py
View file @
2bc86fd8
...
@@ -71,7 +71,7 @@ class Bottleneck(nn.Module):
...
@@ -71,7 +71,7 @@ class Bottleneck(nn.Module):
downsample
=
None
,
downsample
=
None
,
style
=
'pytorch'
,
style
=
'pytorch'
,
with_cp
=
False
):
with_cp
=
False
):
"""Bottleneck block.
"""Bottleneck block
for ResNet
.
If style is "pytorch", the stride-two layer is the 3x3 conv layer,
If style is "pytorch", the stride-two layer is the 3x3 conv layer,
if it is "caffe", the stride-two layer is the first 1x1 conv layer.
if it is "caffe", the stride-two layer is the first 1x1 conv layer.
"""
"""
...
...
mmdet/models/backbones/resnext.py
View file @
2bc86fd8
...
@@ -23,15 +23,17 @@ class Bottleneck(nn.Module):
...
@@ -23,15 +23,17 @@ class Bottleneck(nn.Module):
base_width
=
4
,
base_width
=
4
,
style
=
'pytorch'
,
style
=
'pytorch'
,
with_cp
=
False
):
with_cp
=
False
):
"""Bottleneck block.
"""Bottleneck block
for ResNeXt
.
If style is "pytorch", the stride-two layer is the 3x3 conv layer,
If style is "pytorch", the stride-two layer is the 3x3 conv layer,
if it is "caffe", the stride-two layer is the first 1x1 conv layer.
if it is "caffe", the stride-two layer is the first 1x1 conv layer.
"""
"""
super
(
Bottleneck
,
self
).
__init__
()
super
(
Bottleneck
,
self
).
__init__
()
assert
style
in
[
'pytorch'
,
'caffe'
]
assert
style
in
[
'pytorch'
,
'caffe'
]
width
=
planes
if
groups
==
1
else
math
.
floor
(
if
groups
==
1
:
planes
*
(
base_width
/
64
))
*
groups
width
=
planes
else
:
width
=
math
.
floor
(
planes
*
(
base_width
/
64
))
*
groups
if
style
==
'pytorch'
:
if
style
==
'pytorch'
:
conv1_stride
=
1
conv1_stride
=
1
...
@@ -39,6 +41,7 @@ class Bottleneck(nn.Module):
...
@@ -39,6 +41,7 @@ class Bottleneck(nn.Module):
else
:
else
:
conv1_stride
=
stride
conv1_stride
=
stride
conv2_stride
=
1
conv2_stride
=
1
self
.
conv1
=
nn
.
Conv2d
(
self
.
conv1
=
nn
.
Conv2d
(
inplanes
,
width
,
kernel_size
=
1
,
stride
=
conv1_stride
,
bias
=
False
)
inplanes
,
width
,
kernel_size
=
1
,
stride
=
conv1_stride
,
bias
=
False
)
self
.
bn1
=
nn
.
BatchNorm2d
(
width
)
self
.
bn1
=
nn
.
BatchNorm2d
(
width
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment