          cudnn_checkfile = next((hdr for hdr in cudnn_checkfiles if os.path.isfile(hdr)), None)
          if not cudnn_checkfile:
              return
          found = 0
          with open(cudnn_checkfile, "r") as ofile:
              for line in ofile:
                  if line.lower().startswith("#define cudnn_major"):
                      major = line[line.rfind(" ") + 1:].strip()
                      found += 1
                  elif line.lower().startswith("#define cudnn_minor"):
 
</s> remove         retval = dict()
 </s> add         retval = {} </s> remove             new_names.append("{}_{}".format(name, seen[name]))
 </s> add             new_names.append(f"{name}_{seen[name]}") </s> remove             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]))]
 </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]))]
 </s> remove                 with open(self._config_file, "r") as cnf:
 </s> add                 with open(self._config_file, "r", encoding="utf8") as cnf: </s> remove             return list()
 </s> add             return []
        with open(cudnn_checkfile, "r", encoding="utf8") as ofile:
          cudnn_checkfile = next((hdr for hdr in cudnn_checkfiles if os.path.isfile(hdr)), None)
          if not cudnn_checkfile:
              return
          found = 0
        with open(cudnn_checkfile, "r", encoding="utf8") as ofile:
              for line in ofile:
                  if line.lower().startswith("#define cudnn_major"):
                      major = line[line.rfind(" ") + 1:].strip()
                      found += 1
                  elif line.lower().startswith("#define cudnn_minor"):
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 
setup.py