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
ebc45fc5
Commit
ebc45fc5
authored
Mar 12, 2017
by
Christopher Shallue
Browse files
TF1.0 updates
parent
1bfe902a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
im2txt/im2txt/evaluate.py
im2txt/im2txt/evaluate.py
+5
-5
No files found.
im2txt/im2txt/evaluate.py
View file @
ebc45fc5
...
@@ -62,7 +62,7 @@ def evaluate_model(sess, model, global_step, summary_writer, summary_op):
...
@@ -62,7 +62,7 @@ def evaluate_model(sess, model, global_step, summary_writer, summary_op):
sess: Session object.
sess: Session object.
model: Instance of ShowAndTellModel; the model to evaluate.
model: Instance of ShowAndTellModel; the model to evaluate.
global_step: Integer; global step of the model checkpoint.
global_step: Integer; global step of the model checkpoint.
summary_writer: Instance of
Summary
Writer.
summary_writer: Instance of
File
Writer.
summary_op: Op for generating model summaries.
summary_op: Op for generating model summaries.
"""
"""
# Log model summaries on a single batch.
# Log model summaries on a single batch.
...
@@ -91,7 +91,7 @@ def evaluate_model(sess, model, global_step, summary_writer, summary_op):
...
@@ -91,7 +91,7 @@ def evaluate_model(sess, model, global_step, summary_writer, summary_op):
perplexity
=
math
.
exp
(
sum_losses
/
sum_weights
)
perplexity
=
math
.
exp
(
sum_losses
/
sum_weights
)
tf
.
logging
.
info
(
"Perplexity = %f (%.2g sec)"
,
perplexity
,
eval_time
)
tf
.
logging
.
info
(
"Perplexity = %f (%.2g sec)"
,
perplexity
,
eval_time
)
# Log perplexity to the
Summary
Writer.
# Log perplexity to the
File
Writer.
summary
=
tf
.
Summary
()
summary
=
tf
.
Summary
()
value
=
summary
.
value
.
add
()
value
=
summary
.
value
.
add
()
value
.
simple_value
=
perplexity
value
.
simple_value
=
perplexity
...
@@ -110,7 +110,7 @@ def run_once(model, saver, summary_writer, summary_op):
...
@@ -110,7 +110,7 @@ def run_once(model, saver, summary_writer, summary_op):
Args:
Args:
model: Instance of ShowAndTellModel; the model to evaluate.
model: Instance of ShowAndTellModel; the model to evaluate.
saver: Instance of tf.train.Saver for restoring model Variables.
saver: Instance of tf.train.Saver for restoring model Variables.
summary_writer: Instance of
Summary
Writer.
summary_writer: Instance of
File
Writer.
summary_op: Op for generating model summaries.
summary_op: Op for generating model summaries.
"""
"""
model_path
=
tf
.
train
.
latest_checkpoint
(
FLAGS
.
checkpoint_dir
)
model_path
=
tf
.
train
.
latest_checkpoint
(
FLAGS
.
checkpoint_dir
)
...
@@ -171,8 +171,8 @@ def run():
...
@@ -171,8 +171,8 @@ def run():
saver
=
tf
.
train
.
Saver
()
saver
=
tf
.
train
.
Saver
()
# Create the summary operation and the summary writer.
# Create the summary operation and the summary writer.
summary_op
=
tf
.
merge_all
_summaries
()
summary_op
=
tf
.
summary
.
merge_all
()
summary_writer
=
tf
.
train
.
S
ummaryWriter
(
eval_dir
)
summary_writer
=
tf
.
s
ummary
.
File
Writer
(
eval_dir
)
g
.
finalize
()
g
.
finalize
()
...
...
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