"torchvision/git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "c6c5a5f5765fa1eb28ce7d827254ce10957c8366"
Commit caf3abae authored by Chris Shallue's avatar Chris Shallue Committed by GitHub
Browse files

Merge pull request #1154 from cshallue/master

TF1.0 updates
parents 1bfe902a 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 SummaryWriter. summary_writer: Instance of FileWriter.
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 SummaryWriter. # Log perplexity to the FileWriter.
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 SummaryWriter. summary_writer: Instance of FileWriter.
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.SummaryWriter(eval_dir) summary_writer = tf.summary.FileWriter(eval_dir)
g.finalize() g.finalize()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment