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
99f9442b
"setup.cfg" did not exist on "ad08a792c00cf30ebea36e54b34fbf7a54dc7054"
Commit
99f9442b
authored
May 22, 2017
by
Neal Wu
Browse files
Remove barrier, add tf.identity where appropriate, and make sure tests pass
parent
8e54ffc8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
12 deletions
+6
-12
inception/inception/slim/ops_test.py
inception/inception/slim/ops_test.py
+4
-10
slim/deployment/model_deploy.py
slim/deployment/model_deploy.py
+1
-1
slim/train_image_classifier.py
slim/train_image_classifier.py
+1
-1
No files found.
inception/inception/slim/ops_test.py
View file @
99f9442b
...
...
@@ -418,7 +418,7 @@ class DropoutTest(tf.test.TestCase):
with
self
.
test_session
():
images
=
tf
.
random_uniform
((
5
,
height
,
width
,
3
),
seed
=
1
)
output
=
ops
.
dropout
(
images
)
self
.
assertEquals
(
output
.
op
.
name
,
'Dropout/dropout/mul
_1
'
)
self
.
assertEquals
(
output
.
op
.
name
,
'Dropout/dropout/mul'
)
output
.
get_shape
().
assert_is_compatible_with
(
images
.
get_shape
())
def
testCreateDropoutNoTraining
(
self
):
...
...
@@ -599,9 +599,7 @@ class BatchNormTest(tf.test.TestCase):
output
=
ops
.
batch_norm
(
images
,
decay
=
0.1
)
update_ops
=
tf
.
get_collection
(
ops
.
UPDATE_OPS_COLLECTION
)
with
tf
.
control_dependencies
(
update_ops
):
barrier
=
tf
.
no_op
(
name
=
'gradient_barrier'
)
with
tf
.
control_dependencies
([
barrier
]):
output
=
tf
.
identity
(
output
)
output
=
tf
.
identity
(
output
)
# Initialize all variables
sess
.
run
(
tf
.
global_variables_initializer
())
moving_mean
=
variables
.
get_variables
(
'BatchNorm/moving_mean'
)[
0
]
...
...
@@ -630,9 +628,7 @@ class BatchNormTest(tf.test.TestCase):
output
=
ops
.
batch_norm
(
images
,
decay
=
0.1
,
is_training
=
False
)
update_ops
=
tf
.
get_collection
(
ops
.
UPDATE_OPS_COLLECTION
)
with
tf
.
control_dependencies
(
update_ops
):
barrier
=
tf
.
no_op
(
name
=
'gradient_barrier'
)
with
tf
.
control_dependencies
([
barrier
]):
output
=
tf
.
identity
(
output
)
output
=
tf
.
identity
(
output
)
# Initialize all variables
sess
.
run
(
tf
.
global_variables_initializer
())
moving_mean
=
variables
.
get_variables
(
'BatchNorm/moving_mean'
)[
0
]
...
...
@@ -665,9 +661,7 @@ class BatchNormTest(tf.test.TestCase):
output
=
ops
.
batch_norm
(
images
,
decay
=
0.1
,
is_training
=
False
)
update_ops
=
tf
.
get_collection
(
ops
.
UPDATE_OPS_COLLECTION
)
with
tf
.
control_dependencies
(
update_ops
):
barrier
=
tf
.
no_op
(
name
=
'gradient_barrier'
)
with
tf
.
control_dependencies
([
barrier
]):
output
=
tf
.
identity
(
output
)
output
=
tf
.
identity
(
output
)
# Initialize all variables
sess
.
run
(
tf
.
global_variables_initializer
())
moving_mean
=
variables
.
get_variables
(
'BatchNorm/moving_mean'
)[
0
]
...
...
slim/deployment/model_deploy.py
View file @
99f9442b
...
...
@@ -379,7 +379,7 @@ def deploy(config,
update_op
=
tf
.
group
(
*
update_ops
)
with
tf
.
control_dependencies
([
update_op
]):
train_op
=
t
otal_loss
train_op
=
t
f
.
identity
(
total_loss
,
name
=
'train_op'
)
else
:
clones_losses
=
[]
regularization_losses
=
tf
.
get_collection
(
...
...
slim/train_image_classifier.py
View file @
99f9442b
...
...
@@ -540,7 +540,7 @@ def main(_):
update_op
=
tf
.
group
(
*
update_ops
)
with
tf
.
control_dependencies
([
update_op
]):
train_tensor
=
t
otal_loss
train_tensor
=
t
f
.
identity
(
total_loss
,
name
=
'train_op'
)
# Add the summaries from the first clone. These contain the summaries
# created by model_fn and either optimize_clones() or _gather_clone_loss().
...
...
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