              return
  
          logger.debug("Adding graph")
          existing = list(self.subnotebook_get_titles_ids().keys())
          loss_keys = [key
                       for key in self.display_item.get_loss_keys(Session.session_ids[-1])
                       if key != "total"]
          display_tabs = sorted(set(key[:-1].rstrip("_") for key in loss_keys))
  
          for loss_key in display_tabs:
              tabname = loss_key.replace("_", " ").title()
              if tabname in existing:
 
</s> remove             method = getattr(self, "_calc_{}".format(selection))
 </s> add             method = getattr(self, f"_calc_{selection}") </s> remove                 selected_key = "{}_{}".format(selection, key.replace("raw_", ""))
 </s> add                 selected_key = f"{selection}_{key.replace('raw_', '')}" </s> remove             stats = dict()
 </s> add             stats = {} </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()}

        loss_keys = self.display_item.get_loss_keys(Session.session_ids[-1])
        if not loss_keys:
            # Reload if we attempt to get loss keys before data is written
            logger.debug("Waiting for Session Data to become available to graph")
            self.after(1000, self.display_item_process)
            return

        loss_keys = [key for key in loss_keys if key != "total"]
              return
  
          logger.debug("Adding graph")
          existing = list(self.subnotebook_get_titles_ids().keys())
        loss_keys = self.display_item.get_loss_keys(Session.session_ids[-1])
        if not loss_keys:
            # Reload if we attempt to get loss keys before data is written
            logger.debug("Waiting for Session Data to become available to graph")
            self.after(1000, self.display_item_process)
            return

        loss_keys = [key for key in loss_keys if key != "total"]
        loss_keys = self.display_item.get_loss_keys(Session.session_ids[-1])
        if not loss_keys:
            # Reload if we attempt to get loss keys before data is written
            logger.debug("Waiting for Session Data to become available to graph")
            self.after(1000, self.display_item_process)
            return

        loss_keys = [key for key in loss_keys if key != "total"]
        loss_keys = self.display_item.get_loss_keys(Session.session_ids[-1])
        if not loss_keys:
            # Reload if we attempt to get loss keys before data is written
            logger.debug("Waiting for Session Data to become available to graph")
            self.after(1000, self.display_item_process)
            return

        loss_keys = [key for key in loss_keys if key != "total"]
          display_tabs = sorted(set(key[:-1].rstrip("_") for key in loss_keys))
  
          for loss_key in display_tabs:
              tabname = loss_key.replace("_", " ").title()
              if tabname in existing:
keep keep keep keep replace replace 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/display_command.py