def evaluate():
"""Eval MNIST for a number of steps."""
with tf.Graph().as_default() as g:
# Get images and labels for MNIST.
mnist = input_data.read_data_sets(FLAGS.data_dir, one_hot=False)
images = mnist.test.images
labels = mnist.test.labels
# Build a Graph that computes the logits predictions from the
# inference model.
logits = model.inference(images, keep_prob=1.0)
# Calculate predictions.
top_k_op = tf.nn.in_top_k(predictions=logits, targets=labels, k=1)
# Create saver to restore the learned variables for eval.
saver = tf.train.Saver()
eval_once(saver, top_k_op)
mnist_multi_gpu_eval.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录