          condaexe = ["conda", "search"]
          pkgs = ["cudatoolkit", "cudnn"]
          shell = self.env.os_version[0] == "Windows"
          for pkg in pkgs:
              chk = Popen(condaexe + [pkg], shell=shell, stdout=PIPE)
              available = [line.split()
                           for line in chk.communicate()[0].decode(self.env.encoding).splitlines()
                           if line.startswith(pkg)]
              compatible = [req for req in available
                            if (pkg == "cudatoolkit" and req[1].startswith(versions[0]))
                            or (pkg == "cudnn" and versions[0] in req[2]
                                and req[1].startswith(versions[1]))]
              candidate = "==".join(sorted(compatible, key=lambda x: x[1])[-1][:2])
              self.conda_installer(candidate, verbose=True, conda_only=True)
  
  
  class Tips():
 
</s> remove         self.output.info("Installing {}".format(package.replace("\"", "")))
 </s> add         clean_pkg = package.replace("\"", "")
        self.output.info(f"Installing {clean_pkg}") </s> remove         retval = dict()
 </s> add         retval = {} </s> remove         installed_packages = dict()
        chk = Popen("\"{}\" -m pip freeze".format(sys.executable),
                    shell=True, stdout=PIPE)
        installed = chk.communicate()[0].decode(self.encoding).splitlines()
 </s> add         installed_packages = {}
        with Popen(f"\"{sys.executable}\" -m pip freeze", shell=True, stdout=PIPE) as chk:
            installed = chk.communicate()[0].decode(self.encoding).splitlines() </s> remove         if use_mixed_precision and self._tf_version[0] == 2 and self._tf_version[1] < 4:
 </s> add         if use_mixed_precision and get_tf_version() < 2.4: </s> remove 

@pytest.mark.parametrize('dummy', [None], ids=[get_backend().upper()])
def test_dssim_channels_last(dummy):  # pylint:disable=unused-argument
    """ Basic test for DSSIM Loss """
    prev_data = K.image_data_format()
    K.set_image_data_format('channels_last')
    for input_dim, kernel_size in zip([32, 33], [2, 3]):
        input_shape = [input_dim, input_dim, 3]
        var_x = np.random.random_sample(4 * input_dim * input_dim * 3)
        var_x = var_x.reshape([4] + input_shape)
        var_y = np.random.random_sample(4 * input_dim * input_dim * 3)
        var_y = var_y.reshape([4] + input_shape)

        model = Sequential()
        model.add(Conv2D(32, (3, 3), padding='same', input_shape=input_shape,
                         activation='relu'))
        model.add(Conv2D(3, (3, 3), padding='same', input_shape=input_shape,
                         activation='relu'))
        adam = Adam(lr=0.001, beta_1=0.9, beta_2=0.999, epsilon=1e-8)
        model.compile(loss=losses.DSSIMObjective(kernel_size=kernel_size),
                      metrics=['mse'],
                      optimizer=adam)
        model.fit(var_x, var_y, batch_size=2, epochs=1, shuffle='batch')

        # Test same
        x_1 = K.constant(var_x, 'float32')
        x_2 = K.constant(var_x, 'float32')
        dssim = losses.DSSIMObjective(kernel_size=kernel_size)
        assert_allclose(0.0, K.eval(dssim(x_1, x_2)), atol=1e-4)

        # Test opposite
        x_1 = K.zeros([4] + input_shape)
        x_2 = K.ones([4] + input_shape)
        dssim = losses.DSSIMObjective(kernel_size=kernel_size)
        assert_allclose(0.5, K.eval(dssim(x_1, x_2)), atol=1e-4)

    K.set_image_data_format(prev_data)
 </s> add 
            with Popen(condaexe + [pkg], shell=shell, stdout=PIPE) as chk:
                available = [line.split()
                             for line
                             in chk.communicate()[0].decode(self.env.encoding).splitlines()
                             if line.startswith(pkg)]
                compatible = [req for req in available
                              if (pkg == "cudatoolkit" and req[1].startswith(versions[0]))
                              or (pkg == "cudnn" and versions[0] in req[2]
                                  and req[1].startswith(versions[1]))]

          condaexe = ["conda", "search"]
          pkgs = ["cudatoolkit", "cudnn"]
          shell = self.env.os_version[0] == "Windows"
          for pkg in pkgs:
            with Popen(condaexe + [pkg], shell=shell, stdout=PIPE) as chk:
                available = [line.split()
                             for line
                             in chk.communicate()[0].decode(self.env.encoding).splitlines()
                             if line.startswith(pkg)]
                compatible = [req for req in available
                              if (pkg == "cudatoolkit" and req[1].startswith(versions[0]))
                              or (pkg == "cudnn" and versions[0] in req[2]
                                  and req[1].startswith(versions[1]))]

            with Popen(condaexe + [pkg], shell=shell, stdout=PIPE) as chk:
                available = [line.split()
                             for line
                             in chk.communicate()[0].decode(self.env.encoding).splitlines()
                             if line.startswith(pkg)]
                compatible = [req for req in available
                              if (pkg == "cudatoolkit" and req[1].startswith(versions[0]))
                              or (pkg == "cudnn" and versions[0] in req[2]
                                  and req[1].startswith(versions[1]))]

            with Popen(condaexe + [pkg], shell=shell, stdout=PIPE) as chk:
                available = [line.split()
                             for line
                             in chk.communicate()[0].decode(self.env.encoding).splitlines()
                             if line.startswith(pkg)]
                compatible = [req for req in available
                              if (pkg == "cudatoolkit" and req[1].startswith(versions[0]))
                              or (pkg == "cudnn" and versions[0] in req[2]
                                  and req[1].startswith(versions[1]))]

            with Popen(condaexe + [pkg], shell=shell, stdout=PIPE) as chk:
                available = [line.split()
                             for line
                             in chk.communicate()[0].decode(self.env.encoding).splitlines()
                             if line.startswith(pkg)]
                compatible = [req for req in available
                              if (pkg == "cudatoolkit" and req[1].startswith(versions[0]))
                              or (pkg == "cudnn" and versions[0] in req[2]
                                  and req[1].startswith(versions[1]))]

            with Popen(condaexe + [pkg], shell=shell, stdout=PIPE) as chk:
                available = [line.split()
                             for line
                             in chk.communicate()[0].decode(self.env.encoding).splitlines()
                             if line.startswith(pkg)]
                compatible = [req for req in available
                              if (pkg == "cudatoolkit" and req[1].startswith(versions[0]))
                              or (pkg == "cudnn" and versions[0] in req[2]
                                  and req[1].startswith(versions[1]))]

            with Popen(condaexe + [pkg], shell=shell, stdout=PIPE) as chk:
                available = [line.split()
                             for line
                             in chk.communicate()[0].decode(self.env.encoding).splitlines()
                             if line.startswith(pkg)]
                compatible = [req for req in available
                              if (pkg == "cudatoolkit" and req[1].startswith(versions[0]))
                              or (pkg == "cudnn" and versions[0] in req[2]
                                  and req[1].startswith(versions[1]))]

            with Popen(condaexe + [pkg], shell=shell, stdout=PIPE) as chk:
                available = [line.split()
                             for line
                             in chk.communicate()[0].decode(self.env.encoding).splitlines()
                             if line.startswith(pkg)]
                compatible = [req for req in available
                              if (pkg == "cudatoolkit" and req[1].startswith(versions[0]))
                              or (pkg == "cudnn" and versions[0] in req[2]
                                  and req[1].startswith(versions[1]))]

            with Popen(condaexe + [pkg], shell=shell, stdout=PIPE) as chk:
                available = [line.split()
                             for line
                             in chk.communicate()[0].decode(self.env.encoding).splitlines()
                             if line.startswith(pkg)]
                compatible = [req for req in available
                              if (pkg == "cudatoolkit" and req[1].startswith(versions[0]))
                              or (pkg == "cudnn" and versions[0] in req[2]
                                  and req[1].startswith(versions[1]))]

              candidate = "==".join(sorted(compatible, key=lambda x: x[1])[-1][:2])
              self.conda_installer(candidate, verbose=True, conda_only=True)
  
  
  class Tips():
keep keep keep keep replace replace replace replace replace 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 
setup.py