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
31559b69
Commit
31559b69
authored
Oct 20, 2016
by
drpngx
Committed by
GitHub
Oct 20, 2016
Browse files
Merge pull request #556 from rohitgirdhar/slim_bug_tf11
Fix end point collection to return a dict
parents
1e982561
22e429a1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
slim/nets/alexnet.py
slim/nets/alexnet.py
+1
-1
slim/nets/overfeat.py
slim/nets/overfeat.py
+1
-1
slim/nets/resnet_v1.py
slim/nets/resnet_v1.py
+1
-1
slim/nets/resnet_v2.py
slim/nets/resnet_v2.py
+1
-1
slim/nets/vgg.py
slim/nets/vgg.py
+3
-3
No files found.
slim/nets/alexnet.py
View file @
31559b69
...
@@ -117,7 +117,7 @@ def alexnet_v2(inputs,
...
@@ -117,7 +117,7 @@ def alexnet_v2(inputs,
scope
=
'fc8'
)
scope
=
'fc8'
)
# Convert end_points_collection into a end_point dict.
# Convert end_points_collection into a end_point dict.
end_points
=
dict
(
tf
.
ge
t_collection
(
end_points_collection
)
)
end_points
=
slim
.
utils
.
conver
t_collection
_to_dict
(
end_points_collection
)
if
spatial_squeeze
:
if
spatial_squeeze
:
net
=
tf
.
squeeze
(
net
,
[
1
,
2
],
name
=
'fc8/squeezed'
)
net
=
tf
.
squeeze
(
net
,
[
1
,
2
],
name
=
'fc8/squeezed'
)
end_points
[
sc
.
name
+
'/fc8'
]
=
net
end_points
[
sc
.
name
+
'/fc8'
]
=
net
...
...
slim/nets/overfeat.py
View file @
31559b69
...
@@ -110,7 +110,7 @@ def overfeat(inputs,
...
@@ -110,7 +110,7 @@ def overfeat(inputs,
biases_initializer
=
tf
.
zeros_initializer
,
biases_initializer
=
tf
.
zeros_initializer
,
scope
=
'fc8'
)
scope
=
'fc8'
)
# Convert end_points_collection into a end_point dict.
# Convert end_points_collection into a end_point dict.
end_points
=
dict
(
tf
.
ge
t_collection
(
end_points_collection
)
)
end_points
=
slim
.
utils
.
conver
t_collection
_to_dict
(
end_points_collection
)
if
spatial_squeeze
:
if
spatial_squeeze
:
net
=
tf
.
squeeze
(
net
,
[
1
,
2
],
name
=
'fc8/squeezed'
)
net
=
tf
.
squeeze
(
net
,
[
1
,
2
],
name
=
'fc8/squeezed'
)
end_points
[
sc
.
name
+
'/fc8'
]
=
net
end_points
[
sc
.
name
+
'/fc8'
]
=
net
...
...
slim/nets/resnet_v1.py
View file @
31559b69
...
@@ -198,7 +198,7 @@ def resnet_v1(inputs,
...
@@ -198,7 +198,7 @@ def resnet_v1(inputs,
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'
)
# Convert end_points_collection into a dictionary of end_points.
# Convert end_points_collection into a dictionary of end_points.
end_points
=
dict
(
tf
.
ge
t_collection
(
end_points_collection
)
)
end_points
=
slim
.
utils
.
conver
t_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
net
,
end_points
...
...
slim/nets/resnet_v2.py
View file @
31559b69
...
@@ -207,7 +207,7 @@ def resnet_v2(inputs,
...
@@ -207,7 +207,7 @@ def resnet_v2(inputs,
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'
)
# Convert end_points_collection into a dictionary of end_points.
# Convert end_points_collection into a dictionary of end_points.
end_points
=
dict
(
tf
.
ge
t_collection
(
end_points_collection
)
)
end_points
=
slim
.
utils
.
conver
t_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
net
,
end_points
...
...
slim/nets/vgg.py
View file @
31559b69
...
@@ -114,7 +114,7 @@ def vgg_a(inputs,
...
@@ -114,7 +114,7 @@ def vgg_a(inputs,
normalizer_fn
=
None
,
normalizer_fn
=
None
,
scope
=
'fc8'
)
scope
=
'fc8'
)
# Convert end_points_collection into a end_point dict.
# Convert end_points_collection into a end_point dict.
end_points
=
dict
(
tf
.
ge
t_collection
(
end_points_collection
)
)
end_points
=
slim
.
utils
.
conver
t_collection
_to_dict
(
end_points_collection
)
if
spatial_squeeze
:
if
spatial_squeeze
:
net
=
tf
.
squeeze
(
net
,
[
1
,
2
],
name
=
'fc8/squeezed'
)
net
=
tf
.
squeeze
(
net
,
[
1
,
2
],
name
=
'fc8/squeezed'
)
end_points
[
sc
.
name
+
'/fc8'
]
=
net
end_points
[
sc
.
name
+
'/fc8'
]
=
net
...
@@ -173,7 +173,7 @@ def vgg_16(inputs,
...
@@ -173,7 +173,7 @@ def vgg_16(inputs,
normalizer_fn
=
None
,
normalizer_fn
=
None
,
scope
=
'fc8'
)
scope
=
'fc8'
)
# Convert end_points_collection into a end_point dict.
# Convert end_points_collection into a end_point dict.
end_points
=
dict
(
tf
.
ge
t_collection
(
end_points_collection
)
)
end_points
=
slim
.
utils
.
conver
t_collection
_to_dict
(
end_points_collection
)
if
spatial_squeeze
:
if
spatial_squeeze
:
net
=
tf
.
squeeze
(
net
,
[
1
,
2
],
name
=
'fc8/squeezed'
)
net
=
tf
.
squeeze
(
net
,
[
1
,
2
],
name
=
'fc8/squeezed'
)
end_points
[
sc
.
name
+
'/fc8'
]
=
net
end_points
[
sc
.
name
+
'/fc8'
]
=
net
...
@@ -232,7 +232,7 @@ def vgg_19(inputs,
...
@@ -232,7 +232,7 @@ def vgg_19(inputs,
normalizer_fn
=
None
,
normalizer_fn
=
None
,
scope
=
'fc8'
)
scope
=
'fc8'
)
# Convert end_points_collection into a end_point dict.
# Convert end_points_collection into a end_point dict.
end_points
=
dict
(
tf
.
ge
t_collection
(
end_points_collection
)
)
end_points
=
slim
.
utils
.
conver
t_collection
_to_dict
(
end_points_collection
)
if
spatial_squeeze
:
if
spatial_squeeze
:
net
=
tf
.
squeeze
(
net
,
[
1
,
2
],
name
=
'fc8/squeezed'
)
net
=
tf
.
squeeze
(
net
,
[
1
,
2
],
name
=
'fc8/squeezed'
)
end_points
[
sc
.
name
+
'/fc8'
]
=
net
end_points
[
sc
.
name
+
'/fc8'
]
=
net
...
...
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