def _set_checkpoint_dir(self):
        """Sets the directory containing snapshots of the model."""

        self.cfg_file = self.cfg["cfg_path"]
        if "cfg.yml" in self.cfg_file:
            ckpt_dir = os.path.dirname(self.cfg_file)

        else:
            ckpt_dir = os.path.join(
                path_locations["output_dir"],
                self.cfg_file.replace("experiments/cfgs/", "").replace("cfg.yml", "").replace(".yml", ""),
            )
            # ckpt_dir = os.path.join(self.output_dir,
            #                         self.cfg_file.replace('experiments/cfgs/',
            #                                               '').replace(
            #                             'cfg.yml', '').replace(
            #                             '.yml', ''))
            if not self.test_mode:
                postfix = ""
                ignore_list = ["dataset", "cfg_file", "batch_size"]
                if hasattr(self, "cfg"):
                    if self.cfg is not None:
                        for prop in self.default_properties:
                            if prop in ignore_list:
                                continue

                            if prop.upper() in self.cfg.keys():
                                self_val = getattr(self, prop)
                                if self_val is not None:
                                    if getattr(self, prop) != self.cfg[prop.upper()]:
                                        postfix += "-{}={}".format(prop, self_val).replace(".", "_")

                ckpt_dir += postfix
            ensure_dir(ckpt_dir)

        self.checkpoint_dir = ckpt_dir
        self.debug_dir = self.checkpoint_dir.replace("output", "debug")
        self.encoder_checkpoint_dir = os.path.join(self.checkpoint_dir, "encoding")
        self.encoder_debug_dir = os.path.join(self.debug_dir, "encoding")
        ensure_dir(self.debug_dir)
        ensure_dir(self.encoder_checkpoint_dir)
        ensure_dir(self.encoder_debug_dir)
Sets the directory containing snapshots of the model.
examples/inverse_gan_author_utils.py