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
74ad728e
Commit
74ad728e
authored
Mar 15, 2017
by
Neal Wu
Committed by
GitHub
Mar 15, 2017
Browse files
Use FLAGS.log_frequency directly
parent
29c28d8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
tutorials/image/cifar10/cifar10_train.py
tutorials/image/cifar10/cifar10_train.py
+3
-5
No files found.
tutorials/image/cifar10/cifar10_train.py
View file @
74ad728e
...
@@ -87,16 +87,14 @@ def train():
...
@@ -87,16 +87,14 @@ def train():
return
tf
.
train
.
SessionRunArgs
(
loss
)
# Asks for loss value.
return
tf
.
train
.
SessionRunArgs
(
loss
)
# Asks for loss value.
def
after_run
(
self
,
run_context
,
run_values
):
def
after_run
(
self
,
run_context
,
run_values
):
log_frequency
=
FLAGS
.
log_frequency
if
self
.
_step
%
FLAGS
.
log_frequency
==
0
:
if
self
.
_step
%
log_frequency
==
0
:
current_time
=
time
.
time
()
current_time
=
time
.
time
()
duration
=
current_time
-
self
.
_start_time
duration
=
current_time
-
self
.
_start_time
self
.
_start_time
=
current_time
self
.
_start_time
=
current_time
loss_value
=
run_values
.
results
loss_value
=
run_values
.
results
examples_per_sec
=
log_frequency
*
FLAGS
.
batch_size
/
duration
examples_per_sec
=
FLAGS
.
log_frequency
*
FLAGS
.
batch_size
/
duration
sec_per_batch
=
float
(
duration
/
log_frequency
)
sec_per_batch
=
float
(
duration
/
FLAGS
.
log_frequency
)
format_str
=
(
'%s: step %d, loss = %.2f (%.1f examples/sec; %.3f '
format_str
=
(
'%s: step %d, loss = %.2f (%.1f examples/sec; %.3f '
'sec/batch)'
)
'sec/batch)'
)
...
...
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