Преглед на файлове

Update the evaluation code as well to print results

Neal Wu преди 8 години
родител
ревизия
0d8027484e
променени са 2 файла, в които са добавени 7 реда и са изтрити 4 реда
  1. 1 1
      resnet/README.md
  2. 6 3
      resnet/resnet_main.py

+ 1 - 1
resnet/README.md

@@ -93,7 +93,7 @@ bazel-bin/resnet/resnet_main --train_data_path=cifar10/data_batch* \
                              --dataset='cifar10' \
                              --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
 
 # Evaluate the model.

+ 6 - 3
resnet/resnet_main.py

@@ -128,7 +128,6 @@ def evaluate(hps):
 
   best_precision = 0.0
   while True:
-    time.sleep(60)
     try:
       ckpt_state = tf.train.get_checkpoint_state(FLAGS.log_root)
     except tf.errors.OutOfRangeError as e:
@@ -163,13 +162,17 @@ def evaluate(hps):
         tag='Best Precision', simple_value=best_precision)
     summary_writer.add_summary(best_precision_summ, train_step)
     summary_writer.add_summary(summaries, train_step)
-    tf.logging.info('loss: %.3f, precision: %.3f, best precision: %.3f\n' %
-                    (loss, precision, best_precision))
+    output_str = 'loss: %.3f, precision: %.3f, best precision: %.3f\n' % \
+                 (loss, precision, best_precision)
+    tf.logging.info(output_str)
+    print(output_str)
     summary_writer.flush()
 
     if FLAGS.eval_once:
       break
 
+    time.sleep(60)
+
 
 def main(_):
   if FLAGS.num_gpus == 0: