import tensorflow as tf

            return True
        return False

    def _restore_vars(self, sess):
        """
        :param sess:
        :return: boolean for successful or not
        """
        if not self._restore_optimistic:
            if self.restore_ckpt_file is None:
                logger.warn(
                    Color.yellow('No checkpoint file for restore vars, checkpoint file is None', bold=True))
                return False
            self._restore_saver = tf.train.Saver(self._var_list, name='tk_restore')
            self._restore_saver.restore(sess, self.restore_ckpt_file)
            return True
        else:
            return self._optimistic_restore_model(sess)

    def _optimistic_restore_model(self, sess):
        """
        restore weights of same names with model.
        :param sess:
        :return:
        """
        if self.restore_ckpt_file is None:
