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
1c47fab2
Commit
1c47fab2
authored
Apr 04, 2018
by
Dheera Venkatraman
Browse files
simplify names; bugfix for single-GPU training
parent
b3247557
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
research/deeplab/common.py
research/deeplab/common.py
+0
-1
research/deeplab/train.py
research/deeplab/train.py
+17
-12
No files found.
research/deeplab/common.py
View file @
1c47fab2
...
...
@@ -95,7 +95,6 @@ ORIGINAL_IMAGE = 'original_image'
# Test set name.
TEST_SET
=
'test'
class
ModelOptions
(
collections
.
namedtuple
(
'ModelOptions'
,
[
'outputs_to_num_classes'
,
...
...
research/deeplab/train.py
View file @
1c47fab2
...
...
@@ -181,9 +181,9 @@ def _build_deeplab(inputs_queue, outputs_to_num_classes, ignore_label):
"""
samples
=
inputs_queue
.
dequeue
()
# add name input and label so we can add to summary
samples
[
common
.
IMAGE
]
=
tf
.
identity
(
samples
[
common
.
IMAGE
],
'input_image'
)
samples
[
common
.
LABEL
]
=
tf
.
identity
(
samples
[
common
.
LABEL
],
'input_label'
)
# add name
to
input and label
nodes
so we can add to summary
samples
[
common
.
IMAGE
]
=
tf
.
identity
(
samples
[
common
.
IMAGE
],
name
=
common
.
IMAGE
)
samples
[
common
.
LABEL
]
=
tf
.
identity
(
samples
[
common
.
LABEL
],
name
=
common
.
LABEL
)
model_options
=
common
.
ModelOptions
(
outputs_to_num_classes
=
outputs_to_num_classes
,
...
...
@@ -201,7 +201,7 @@ def _build_deeplab(inputs_queue, outputs_to_num_classes, ignore_label):
# add name to graph node so we can add to summary
outputs_to_scales_to_logits
[
common
.
OUTPUT_TYPE
][
model
.
_MERGED_LOGITS_SCOPE
]
=
tf
.
identity
(
outputs_to_scales_to_logits
[
common
.
OUTPUT_TYPE
][
model
.
_MERGED_LOGITS_SCOPE
],
name
=
OUTPUT_MERGED_LOGITS_NOD
E
name
=
common
.
OUTPUT_TYP
E
)
for
output
,
num_classes
in
six
.
iteritems
(
outputs_to_num_classes
):
...
...
@@ -283,14 +283,19 @@ def main(unused_argv):
# Add summaries for images, labels, semantic predictions
if
FLAGS
.
save_summaries_images
:
summary_image
=
graph
.
get_tensor_by_name
(
'%s/%s:0'
%
first_clone_slope
,
INPUT_LABEL_NODE
)
summaries
.
add
(
tf
.
summary
.
image
(
'samples/%s'
%
INPUT_IMAGE_NODE
,
summary_image
))
summary_label
=
tf
.
cast
(
graph
.
get_tensor_by_name
(
'%s/%s:0'
%
first_clone_slope
,
INPUT_LABEL_NODE
),
tf
.
uint8
)
summaries
.
add
(
tf
.
summary
.
image
(
'samples/%s'
%
INPUT_LABEL_NODE
,
summary_label
))
predictions
=
tf
.
cast
(
tf
.
expand_dims
(
tf
.
argmax
(
graph
.
get_tensor_by_name
(
'%s/%s:0'
%
first_clone_scope
,
OUTPUT_MERGED_LOGITS_NODE
),
3
),
-
1
),
tf
.
uint8
)
summaries
.
add
(
tf
.
summary
.
image
(
'samples/%s'
%
OUTPUT_MERGED_LOGITS_NODE
,
predictions
))
summary_image
=
graph
.
get_tensor_by_name
(
(
'%s/%s:0'
%
(
first_clone_scope
,
common
.
IMAGE
)).
strip
(
'/'
))
summaries
.
add
(
tf
.
summary
.
image
(
'samples/%s'
%
common
.
IMAGE
,
summary_image
))
summary_label
=
tf
.
cast
(
graph
.
get_tensor_by_name
(
(
'%s/%s:0'
%
(
first_clone_scope
,
common
.
LABEL
)).
strip
(
'/'
)),
tf
.
uint8
)
summaries
.
add
(
tf
.
summary
.
image
(
'samples/%s'
%
common
.
LABEL
,
summary_label
))
predictions
=
tf
.
cast
(
tf
.
expand_dims
(
tf
.
argmax
(
graph
.
get_tensor_by_name
(
(
'%s/%s:0'
%
(
first_clone_scope
,
common
.
OUTPUT_TYPE
)).
strip
(
'/'
)),
3
),
-
1
),
tf
.
uint8
)
summaries
.
add
(
tf
.
summary
.
image
(
'samples/%s'
%
common
.
OUTPUT_TYPE
,
predictions
))
# Add summaries for losses.
for
loss
in
tf
.
get_collection
(
tf
.
GraphKeys
.
LOSSES
,
first_clone_scope
):
...
...
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