mnist_multi_gpu_eval.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:mnist-multi-gpu 作者: normanheckscher 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号