def main(_, run_eval_loop=True):
    with tf.name_scope('inputs'):
        (noise, one_hot_labels) = _get_generator_inputs(FLAGS.num_images_per_class, NUM_CLASSES, FLAGS.noise_dims)
    with tf.variable_scope('Generator'):
        images = networks.conditional_generator((noise, one_hot_labels), is_training=False)
    reshaped_img = tfgan.eval.image_reshaper(images, num_cols=FLAGS.num_images_per_class)
    tf.summary.image('generated_images', reshaped_img, max_outputs=1)
    tf.summary.scalar('MNIST_Classifier_score', util.mnist_score(images, FLAGS.classifier_filename))
    tf.summary.scalar('MNIST_Cross_entropy', util.mnist_cross_entropy(images, one_hot_labels, FLAGS.classifier_filename))
    image_write_ops = None
    if FLAGS.write_to_disk:
        image_write_ops = tf.write_file(('%s/%s' % (FLAGS.eval_dir, 'conditional_gan.png')), tf.image.encode_png(data_provider.float_image_to_uint8(reshaped_img[0])))
    if (not run_eval_loop):
        return
    tf.contrib.training.evaluate_repeatedly(FLAGS.checkpoint_dir, hooks=[tf.contrib.training.SummaryAtEndHook(FLAGS.eval_dir), tf.contrib.training.StopAfterNEvalsHook(1)], eval_ops=image_write_ops, max_number_of_evaluations=FLAGS.max_number_of_evaluations)
def main(_, run_eval_loop=True):
    with tf.name_scope('inputs'):
        (noise, one_hot_labels) = _get_generator_inputs(FLAGS.num_images_per_class, NUM_CLASSES, FLAGS.noise_dims)
    with tf.variable_scope('Generator'):
        images = networks.conditional_generator((noise, one_hot_labels), is_training=False)
    reshaped_img = tfgan.eval.image_reshaper(images, num_cols=FLAGS.num_images_per_class)
    tf.summary.image('generated_images', reshaped_img, max_outputs=1)
    tf.summary.scalar('MNIST_Classifier_score', util.mnist_score(images, FLAGS.classifier_filename))
    tf.summary.scalar('MNIST_Cross_entropy', util.mnist_cross_entropy(images, one_hot_labels, FLAGS.classifier_filename))
    image_write_ops = None
    if FLAGS.write_to_disk:
        image_write_ops = tf.write_file(('%s/%s' % (FLAGS.eval_dir, 'conditional_gan.png')), tf.image.encode_png(data_provider.float_image_to_uint8(reshaped_img[0])))
    if (not run_eval_loop):
        return
    tf.contrib.training.evaluate_repeatedly(FLAGS.checkpoint_dir, hooks=[tf.contrib.training.SummaryAtEndHook(FLAGS.eval_dir), tf.contrib.training.StopAfterNEvalsHook(1)], eval_ops=image_write_ops, max_number_of_evaluations=FLAGS.max_number_of_evaluations)