              self.session_id = max(int(key) for key in self.state["sessions"].keys())
          else:
              self.session_id = session_id
          self.initialized = True
          logger.debug("Initialized session")
  
      def load_state_file(self):
          """ Load the current state file """
          state_file = os.path.join(self.modeldir, "{}_state.json".format(self.modelname))
          logger.debug("Loading State: '%s'", state_file)
 
</s> remove         dst = str(get_folder("{}_snapshot_{}_iters".format(self.model_dir, iterations)))
 </s> add         snapshot_dir = "{}_snapshot_{}_iters".format(self.model_dir, iterations)

        if os.path.isdir(snapshot_dir):
            logger.debug("Removing previously existing snapshot folder: '%s'", snapshot_dir)
            rmtree(snapshot_dir)

        dst = str(get_folder(snapshot_dir)) </s> remove         self.statusbar = get_config().statusbar
 </s> add         self.config = get_config()
        self.statusbar = self.config.statusbar </s> remove         logger.trace("Loading aligned face: (size: %s, align_eyes: %s, dtype: %s)",
                     size, align_eyes, dtype)
        padding = int(size * self.extract_ratio) // 2
        self.aligned["size"] = size
        self.aligned["padding"] = padding
        self.aligned["align_eyes"] = align_eyes
        self.aligned["matrix"] = get_align_mat(self, size, align_eyes)
        if image is None:
            self.aligned["face"] = None
 </s> add         # Don't reload an already aligned face:
        if self.aligned:
            logger.trace("Skipping alignment calculation for already aligned face") </s> remove         if not get_config().session.initialized and iterations > 0:
            # Don't initialize session until after the first iteration as state
            # file must exist first
            get_config().session.initialize_session(is_training=True)

 </s> add 
        logger.debug("Initialized session. Session_ID: %s", self.session_id)
              self.session_id = max(int(key) for key in self.state["sessions"].keys())
          else:
              self.session_id = session_id
          self.initialized = True
        logger.debug("Initialized session. Session_ID: %s", self.session_id)
  
      def load_state_file(self):
          """ Load the current state file """
          state_file = os.path.join(self.modeldir, "{}_state.json".format(self.modelname))
          logger.debug("Loading State: '%s'", state_file)
keep keep keep keep replace keep keep keep keep keep
 Bugfixes

- Fix filter/nfilter for convert
- Remove existing snapshot folder before creating if it pre-exists
- Don't initialize training session until after first save. "Nonetype" session fix 
lib/gui/stats.py