          If a training session is running, then updates the training sessions stats only.
          """
          if self._per_session_stats is None:
              logger.debug("Collating per session stats")
              compiled = list()
              for session_id, ts_data in self._time_stats.items():
                  logger.debug("Compiling session ID: %s", session_id)
                  if self._state is None:
                      logger.debug("Session state dict doesn't exist. Most likely task has been "
                                   "terminated during compilation")
 
</s> remove         retval = dict()
 </s> add         retval = {} </s> remove         loss_keys = {sess_id: list(logs.keys())
                     for sess_id, logs in self._tb_logs.get_loss(session_id=session_id).items()}
 </s> add         if get_backend() == "amd":
            # We can't log the graph in Tensorboard logs for AMD so need to obtain from state file
            loss_keys = {int(sess_id): [name for name in session["loss_names"] if name != "total"]
                         for sess_id, session in self._state["sessions"].items()}
        else:
            loss_keys = {sess_id: list(logs.keys())
                         for sess_id, logs
                         in self._tb_logs.get_loss(session_id=session_id).items()}
 </s> remove                 for sess_id, sess in self._state.get("sessions", dict()).items()}
 </s> add                 for sess_id, sess in self._state.get("sessions", {}).items()} </s> remove     msg = "{}  has been deprecated and will be removed from a future update.".format(function)
 </s> add     msg = f"{function}  has been deprecated and will be removed from a future update." </s> remove         msg += " {}".format(additional_info)
 </s> add         msg += f" {additional_info}"
            compiled = []
          If a training session is running, then updates the training sessions stats only.
          """
          if self._per_session_stats is None:
              logger.debug("Collating per session stats")
            compiled = []
              for session_id, ts_data in self._time_stats.items():
                  logger.debug("Compiling session ID: %s", session_id)
                  if self._state is None:
                      logger.debug("Session state dict doesn't exist. Most likely task has been "
                                   "terminated during compilation")
keep keep keep keep replace keep keep keep keep keep
 Update code to support Tensorflow versions up to 2.8 (#1213)

* Update maximum tf version in setup + requirements

* - bump max version of tf version in launcher
- standardise tf version check

* update keras get_custom_objects  for tf>2.6

* bugfix: force black text in GUI file dialogs (linux)

* dssim loss - Move to stock tf.ssim function

* Update optimizer imports for compatibility

* fix logging for tf2.8

* Fix GUI graphing for TF2.8

* update tests

* bump requirements.txt versions

* Remove limit on nvidia-ml-py

* Graphing bugfixes
  - Prevent live graph from displaying if data not yet available

* bugfix: Live graph. Collect loss labels correctly

* fix: live graph - swallow inconsistent loss errors

* Bugfix: Prevent live graph from clearing during training

* Fix graphing for AMD 
lib/gui/analysis/stats.py