import tensorflow as tf

    images, labels = input_name.build_input(
        FLAGS.dataset, FLAGS.eval_data_path, hps.batch_size, FLAGS.mode)  # FLAGS.mode='attack', batch_size=200
    Res = model_name.ResNet(hps, images, FLAGS.mode, Reuse=False)
    Res.build_graph()
    saver = tf.train.Saver()
    adv_images = adv_craft_func(hps, images, FLAGS.attack_method, eps=FLAGS.eps, RCE_train=FLAGS.RCE_train)
    model_nor = model_name.ResNet(hps, images, FLAGS.mode, Reuse=True)
    model_nor.build_graph()
    model_adv = model_name.ResNet(hps, adv_images, FLAGS.mode, Reuse=True)
    model_adv.build_graph()

    # Open session and restore checkpoint
    sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True))
    tf.train.start_queue_runners(sess)
    sess.run(tf.global_variables_initializer())

    ckpt_state = tf.train.get_checkpoint_state(FLAGS.log_root)  # Choose dir according to rt
    tf.logging.info('Loading checkpoint %s', ckpt_state.model_checkpoint_path)
    saver.restore(sess, ckpt_state.model_checkpoint_path)

    logits_nor = model_nor.t_SNE_logits
    logits_adv = model_adv.t_SNE_logits

    dim_logits = logits_nor.shape[1]
    if hps.batch_size!=logits_nor.shape[0]:
        print('Error!!!!!')
        return
    logits_all = np.reshape(np.array([]),(0,dim_logits))
