          self._set_tf_settings(allow_growth, arguments.exclude_gpus)
  
          use_mixed_precision = not is_predict and mixed_precision and get_backend() == "nvidia"
          # Mixed precision moved out of experimental in tensorflow 2.4
          if use_mixed_precision and self._tf_version[0] == 2 and self._tf_version[1] < 4:
              self._mixed_precision = tf.keras.mixed_precision.experimental
          elif use_mixed_precision:
              self._mixed_precision = tf.keras.mixed_precision
          else:
              self._mixed_precision = None
 
</s> remove         self._tf_version = [int(i) for i in tf.__version__.split(".")[:2]]
 </s> add  </s> remove         if self._tf_version[0] == 2 and self._tf_version[1] < 4:
 </s> add         if get_tf_version() < 2.4: </s> remove         if exclude_gpus and self._tf_version[0] == 2 and self._tf_version[1] == 2:
 </s> add         if exclude_gpus and get_tf_version() == 2.2: </s> remove             # pylint:disable=import-outside-toplevel,protected-access,import-error
 </s> add             # pylint:disable=import-outside-toplevel,protected-access
            # pylint:disable=import-error,no-name-in-module </s> remove         vers = self._tf_version
        kwargs = dict(loss_scale="dynamic") if vers[0] == 2 and vers[1] < 4 else dict()
        logger.debug("tf version: %s, kwargs: %s", vers, kwargs)
 </s> add         kwargs = dict(loss_scale="dynamic") if get_tf_version() < 2.4 else {}
        logger.debug("tf version: %s, kwargs: %s", get_tf_version(), kwargs)
        if use_mixed_precision and get_tf_version() < 2.4:
          self._set_tf_settings(allow_growth, arguments.exclude_gpus)
  
          use_mixed_precision = not is_predict and mixed_precision and get_backend() == "nvidia"
          # Mixed precision moved out of experimental in tensorflow 2.4
        if use_mixed_precision and get_tf_version() < 2.4:
              self._mixed_precision = tf.keras.mixed_precision.experimental
          elif use_mixed_precision:
              self._mixed_precision = tf.keras.mixed_precision
          else:
              self._mixed_precision = None
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 
plugins/train/model/_base.py