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
ResNet50_tensorflow
Commits
9dd2c618
Commit
9dd2c618
authored
Feb 28, 2017
by
Neal Wu
Browse files
Perform the squeeze in a more appropriate location
parent
a9d0e6e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
slim/nets/resnet_v2.py
slim/nets/resnet_v2.py
+2
-2
slim/train_image_classifier.py
slim/train_image_classifier.py
+1
-1
No files found.
slim/nets/resnet_v2.py
View file @
9dd2c618
...
@@ -206,12 +206,12 @@ def resnet_v2(inputs,
...
@@ -206,12 +206,12 @@ def resnet_v2(inputs,
if
num_classes
is
not
None
:
if
num_classes
is
not
None
:
net
=
slim
.
conv2d
(
net
,
num_classes
,
[
1
,
1
],
activation_fn
=
None
,
net
=
slim
.
conv2d
(
net
,
num_classes
,
[
1
,
1
],
activation_fn
=
None
,
normalizer_fn
=
None
,
scope
=
'logits'
)
normalizer_fn
=
None
,
scope
=
'logits'
)
logits
=
tf
.
squeeze
(
net
,
[
1
,
2
],
name
=
'SpatialSqueeze'
)
# Convert end_points_collection into a dictionary of end_points.
# Convert end_points_collection into a dictionary of end_points.
end_points
=
slim
.
utils
.
convert_collection_to_dict
(
end_points_collection
)
end_points
=
slim
.
utils
.
convert_collection_to_dict
(
end_points_collection
)
if
num_classes
is
not
None
:
if
num_classes
is
not
None
:
end_points
[
'predictions'
]
=
slim
.
softmax
(
net
,
scope
=
'predictions'
)
end_points
[
'predictions'
]
=
slim
.
softmax
(
net
,
scope
=
'predictions'
)
return
net
,
end_points
return
logits
,
end_points
resnet_v2
.
default_image_size
=
224
def
resnet_v2_50
(
inputs
,
def
resnet_v2_50
(
inputs
,
...
...
slim/train_image_classifier.py
View file @
9dd2c618
...
@@ -473,7 +473,7 @@ def main(_):
...
@@ -473,7 +473,7 @@ def main(_):
end_points
[
'AuxLogits'
],
labels
,
end_points
[
'AuxLogits'
],
labels
,
label_smoothing
=
FLAGS
.
label_smoothing
,
weights
=
0.4
,
scope
=
'aux_loss'
)
label_smoothing
=
FLAGS
.
label_smoothing
,
weights
=
0.4
,
scope
=
'aux_loss'
)
tf
.
losses
.
softmax_cross_entropy
(
tf
.
losses
.
softmax_cross_entropy
(
tf
.
squeeze
(
logits
)
,
labels
,
label_smoothing
=
FLAGS
.
label_smoothing
,
weights
=
1.0
)
logits
,
labels
,
label_smoothing
=
FLAGS
.
label_smoothing
,
weights
=
1.0
)
return
end_points
return
end_points
# Gather initial summaries.
# Gather initial summaries.
...
...
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