import tensorflow as tf


    # 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:
      tf.summary.scalar(name, var, [collection])
      tf.summary.scalar('log_' + name, tf.log(var), [collection])

  def _restore_model(self, session):
    latest_checkpoint = self.get_latest_checkpoint()
    print(latest_checkpoint)
    if latest_checkpoint is not None:
      latest_checkpoint = latest_checkpoint.replace(EMB_SUFFIX, '')
    ut.print_info("latest checkpoint: %s" % latest_checkpoint)
