"git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "59c6731897c2b8c48431136515ee80d235c9c2d1"
Commit 0d802748 authored by Neal Wu's avatar Neal Wu
Browse files

Update the evaluation code as well to print results

parent 0b9c1d30
...@@ -93,7 +93,7 @@ bazel-bin/resnet/resnet_main --train_data_path=cifar10/data_batch* \ ...@@ -93,7 +93,7 @@ bazel-bin/resnet/resnet_main --train_data_path=cifar10/data_batch* \
--dataset='cifar10' \ --dataset='cifar10' \
--num_gpus=1 --num_gpus=1
# Note that training takes about 5 hours on a TITAN X GPU, but the training script will not produce any output. In the meantime you can check on progress using tensorboard: # Note that training takes about 5 hours on a K40 GPU, but the training script will not produce any output. In the meantime you can check on progress using tensorboard:
tensorboard --logdir=/tmp/resnet_model tensorboard --logdir=/tmp/resnet_model
# Evaluate the model. # Evaluate the model.
......
...@@ -128,7 +128,6 @@ def evaluate(hps): ...@@ -128,7 +128,6 @@ def evaluate(hps):
best_precision = 0.0 best_precision = 0.0
while True: while True:
time.sleep(60)
try: try:
ckpt_state = tf.train.get_checkpoint_state(FLAGS.log_root) ckpt_state = tf.train.get_checkpoint_state(FLAGS.log_root)
except tf.errors.OutOfRangeError as e: except tf.errors.OutOfRangeError as e:
...@@ -163,13 +162,17 @@ def evaluate(hps): ...@@ -163,13 +162,17 @@ def evaluate(hps):
tag='Best Precision', simple_value=best_precision) tag='Best Precision', simple_value=best_precision)
summary_writer.add_summary(best_precision_summ, train_step) summary_writer.add_summary(best_precision_summ, train_step)
summary_writer.add_summary(summaries, train_step) summary_writer.add_summary(summaries, train_step)
tf.logging.info('loss: %.3f, precision: %.3f, best precision: %.3f\n' % output_str = 'loss: %.3f, precision: %.3f, best precision: %.3f\n' % \
(loss, precision, best_precision)) (loss, precision, best_precision)
tf.logging.info(output_str)
print(output_str)
summary_writer.flush() summary_writer.flush()
if FLAGS.eval_once: if FLAGS.eval_once:
break break
time.sleep(60)
def main(_): def main(_):
if FLAGS.num_gpus == 0: if FLAGS.num_gpus == 0:
......
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