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
86187a20
Unverified
Commit
86187a20
authored
Apr 28, 2019
by
Kai Chen
Committed by
GitHub
Apr 28, 2019
Browse files
Merge pull request #560 from hellock/hotfix
Bug fix for freezing BN parameters
parents
11ea6cfb
c899cdf1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
mmdet/models/backbones/resnet.py
mmdet/models/backbones/resnet.py
+2
-0
No files found.
mmdet/models/backbones/resnet.py
View file @
86187a20
...
@@ -421,12 +421,14 @@ class ResNet(nn.Module):
...
@@ -421,12 +421,14 @@ class ResNet(nn.Module):
def
_freeze_stages
(
self
):
def
_freeze_stages
(
self
):
if
self
.
frozen_stages
>=
0
:
if
self
.
frozen_stages
>=
0
:
self
.
norm1
.
eval
()
for
m
in
[
self
.
conv1
,
self
.
norm1
]:
for
m
in
[
self
.
conv1
,
self
.
norm1
]:
for
param
in
m
.
parameters
():
for
param
in
m
.
parameters
():
param
.
requires_grad
=
False
param
.
requires_grad
=
False
for
i
in
range
(
1
,
self
.
frozen_stages
+
1
):
for
i
in
range
(
1
,
self
.
frozen_stages
+
1
):
m
=
getattr
(
self
,
'layer{}'
.
format
(
i
))
m
=
getattr
(
self
,
'layer{}'
.
format
(
i
))
m
.
eval
()
for
param
in
m
.
parameters
():
for
param
in
m
.
parameters
():
param
.
requires_grad
=
False
param
.
requires_grad
=
False
...
...
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