from tensorflow.contrib.tensorboard.plugins import projector

    self.embedding_assign = self.embedding_test.assign(self.embedding_test_ph)
    self.embedding_saver = tf.train.Saver(var_list=[self.embedding_test])

    config = projector.ProjectorConfig()
    embedding = config.embeddings.add()
    embedding.tensor_name = self.embedding_test.name
    embedding.sprite.image_path = './sprite.png'
    embedding.sprite.single_image_dim.extend([80, 80])
    embedding.metadata_path = './metadata.tsv'
    projector.visualize_embeddings(self.summary_writer, config)
    sess.run(tf.variables_initializer([self.embedding_test], name='init_embeddings'))

    # build sprite image
    ut.images_to_sprite(self.test_set, path=os.path.join(FLAGS.logdir, 'sprite.png'))
    ut.generate_tsv(len(self.test_set), tsv_path)

  def _add_loss_summary(self, name, var, collection='train'):
    if var is not None:
