                      if "[saved models]" in output.strip().lower():
                          logger.debug("Trigger GUI Training update")
                          logger.trace("tk_vars: %s", {itm: var.get()
                                                       for itm, var in self.wrapper.tk_vars.items()})
                          if not self.config.session.initialized:
                              # Don't initialize session until after the first save as state
                              # file must exist first
                              logger.debug("Initializing curret training session")
                              self.config.session.initialize_session(is_training=True)
                          self.wrapper.tk_vars["updatepreview"].set(True)
 
</s> remove                             self.config.session.initialize_session(is_training=True)
 </s> add                             Session.initialize_session(
                                self._session_info["model_folder"],
                                self._session_info["model_name"],
                                is_training=True) </s> remove         msg = "Currently running training session"
        self._session = session
        # Reload the state file to get approx currently training iterations
        self._session.load_state_file()
        self._set_session_summary(msg)
 </s> add         self._clear_session()
        self._set_session_summary("Currently running training session") </s> remove         if session.logging_disabled:
 </s> add         if Session.logging_disabled: </s> remove         self._clear_session()
        session = get_config().session
        if not session.initialized:
 </s> add         if not Session.is_training:
                        if not Session.is_training:
                      if "[saved models]" in output.strip().lower():
                          logger.debug("Trigger GUI Training update")
                          logger.trace("tk_vars: %s", {itm: var.get()
                                                       for itm, var in self.wrapper.tk_vars.items()})
                        if not Session.is_training:
                              # Don't initialize session until after the first save as state
                              # file must exist first
                              logger.debug("Initializing curret training session")
                              self.config.session.initialize_session(is_training=True)
                          self.wrapper.tk_vars["updatepreview"].set(True)
keep keep keep keep replace keep keep keep keep keep
 GUI - Stats optimization (#1067)

* Faster stat loading + caching

* Compress data in cache

* Optimize some calculations

* Vectorize smoothing

* stats.Calculations optimized

* Load latest training data from live iterator

* Add options to training graph 
lib/gui/wrapper.py