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
OpenDAS
vision
Commits
7770b04e
Unverified
Commit
7770b04e
authored
Oct 11, 2021
by
Vasilis Vryniotis
Committed by
GitHub
Oct 11, 2021
Browse files
Fixing bug on SSD backbone freezing. (#4590)
parent
221dd5f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
torchvision/models/detection/ssd.py
torchvision/models/detection/ssd.py
+2
-2
No files found.
torchvision/models/detection/ssd.py
View file @
7770b04e
...
@@ -532,7 +532,7 @@ def _vgg_extractor(backbone_name: str, highres: bool, progress: bool, pretrained
...
@@ -532,7 +532,7 @@ def _vgg_extractor(backbone_name: str, highres: bool, progress: bool, pretrained
backbone
=
vgg
.
__dict__
[
backbone_name
](
pretrained
=
pretrained
,
progress
=
progress
).
features
backbone
=
vgg
.
__dict__
[
backbone_name
](
pretrained
=
pretrained
,
progress
=
progress
).
features
# Gather the indices of maxpools. These are the locations of output blocks.
# Gather the indices of maxpools. These are the locations of output blocks.
stage_indices
=
[
i
for
i
,
b
in
enumerate
(
backbone
)
if
isinstance
(
b
,
nn
.
MaxPool2d
)]
stage_indices
=
[
0
]
+
[
i
for
i
,
b
in
enumerate
(
backbone
)
if
isinstance
(
b
,
nn
.
MaxPool2d
)]
[:
-
1
]
num_stages
=
len
(
stage_indices
)
num_stages
=
len
(
stage_indices
)
# find the index of the layer from which we wont freeze
# find the index of the layer from which we wont freeze
...
@@ -602,7 +602,7 @@ def ssd300_vgg16(
...
@@ -602,7 +602,7 @@ def ssd300_vgg16(
warnings
.
warn
(
"The size of the model is already fixed; ignoring the argument."
)
warnings
.
warn
(
"The size of the model is already fixed; ignoring the argument."
)
trainable_backbone_layers
=
_validate_trainable_layers
(
trainable_backbone_layers
=
_validate_trainable_layers
(
pretrained
or
pretrained_backbone
,
trainable_backbone_layers
,
5
,
5
pretrained
or
pretrained_backbone
,
trainable_backbone_layers
,
5
,
4
)
)
if
pretrained
:
if
pretrained
:
...
...
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