          else:
              try:
                  self.device_count = pynvml.nvmlDeviceGetCount()
              except pynvml.NVMLError:
                  self.device_count = 0
          if self.logger:
              self.logger.debug("GPU Device count: %s", self.device_count)
  
      def get_active_devices(self):
          """ Return list of active Nvidia devices """
          if self.plaid is not None:
              self.active_devices = self.plaid.active_devices
          else:
              devices = os.environ.get("CUDA_VISIBLE_DEVICES", None)
              if self.device_count == 0:
                  self.active_devices = list()
              elif devices is not None:
 
</s> remove             if self.device_count == 0:
                self.active_devices = list()
 </s> add             if self._device_count == 0:
                self._active_devices = list() </s> remove             self.device_count = pynvx.cudaDeviceGetCount(ignore=True)
 </s> add             self._device_count = pynvx.cudaDeviceGetCount(ignore=True) </s> remove                 self.device_count = pynvml.nvmlDeviceGetCount()
 </s> add                 self._device_count = pynvml.nvmlDeviceGetCount() </s> remove                 self.active_devices = [int(i) for i in devices.split(",") if devices]
 </s> add                 self._active_devices = [int(i) for i in devices.split(",") if devices] </s> remove     def get_device_count(self):
        """ Return count of Nvidia devices """
        if self.plaid is not None:
            self.device_count = self.plaid.device_count
 </s> add     def _get_device_count(self):
        """ Detect the number of GPUs attached to the system and allocate to
        :attr:`_device_count`. """
        if self._is_plaidml:
            self._device_count = self._plaid.device_count
                self._device_count = 0
        self._log("debug", "GPU Device count: {}".format(self._device_count))

    def _get_active_devices(self):
        """ Obtain the indices of active GPUs (those that have not been explicitly excluded by
        CUDA_VISIBLE_DEVICES or plaidML) and allocate to :attr:`_active_devices`. """
        if self._is_plaidml:
            self._active_devices = self._plaid.active_devices
          else:
              try:
                  self.device_count = pynvml.nvmlDeviceGetCount()
              except pynvml.NVMLError:
                self._device_count = 0
        self._log("debug", "GPU Device count: {}".format(self._device_count))

    def _get_active_devices(self):
        """ Obtain the indices of active GPUs (those that have not been explicitly excluded by
        CUDA_VISIBLE_DEVICES or plaidML) and allocate to :attr:`_active_devices`. """
        if self._is_plaidml:
            self._active_devices = self._plaid.active_devices
                self._device_count = 0
        self._log("debug", "GPU Device count: {}".format(self._device_count))

    def _get_active_devices(self):
        """ Obtain the indices of active GPUs (those that have not been explicitly excluded by
        CUDA_VISIBLE_DEVICES or plaidML) and allocate to :attr:`_active_devices`. """
        if self._is_plaidml:
            self._active_devices = self._plaid.active_devices
                self._device_count = 0
        self._log("debug", "GPU Device count: {}".format(self._device_count))

    def _get_active_devices(self):
        """ Obtain the indices of active GPUs (those that have not been explicitly excluded by
        CUDA_VISIBLE_DEVICES or plaidML) and allocate to :attr:`_active_devices`. """
        if self._is_plaidml:
            self._active_devices = self._plaid.active_devices
                self._device_count = 0
        self._log("debug", "GPU Device count: {}".format(self._device_count))

    def _get_active_devices(self):
        """ Obtain the indices of active GPUs (those that have not been explicitly excluded by
        CUDA_VISIBLE_DEVICES or plaidML) and allocate to :attr:`_active_devices`. """
        if self._is_plaidml:
            self._active_devices = self._plaid.active_devices
                self._device_count = 0
        self._log("debug", "GPU Device count: {}".format(self._device_count))

    def _get_active_devices(self):
        """ Obtain the indices of active GPUs (those that have not been explicitly excluded by
        CUDA_VISIBLE_DEVICES or plaidML) and allocate to :attr:`_active_devices`. """
        if self._is_plaidml:
            self._active_devices = self._plaid.active_devices
                self._device_count = 0
        self._log("debug", "GPU Device count: {}".format(self._device_count))

    def _get_active_devices(self):
        """ Obtain the indices of active GPUs (those that have not been explicitly excluded by
        CUDA_VISIBLE_DEVICES or plaidML) and allocate to :attr:`_active_devices`. """
        if self._is_plaidml:
            self._active_devices = self._plaid.active_devices
                self._device_count = 0
        self._log("debug", "GPU Device count: {}".format(self._device_count))

    def _get_active_devices(self):
        """ Obtain the indices of active GPUs (those that have not been explicitly excluded by
        CUDA_VISIBLE_DEVICES or plaidML) and allocate to :attr:`_active_devices`. """
        if self._is_plaidml:
            self._active_devices = self._plaid.active_devices
                self._device_count = 0
        self._log("debug", "GPU Device count: {}".format(self._device_count))

    def _get_active_devices(self):
        """ Obtain the indices of active GPUs (those that have not been explicitly excluded by
        CUDA_VISIBLE_DEVICES or plaidML) and allocate to :attr:`_active_devices`. """
        if self._is_plaidml:
            self._active_devices = self._plaid.active_devices
          else:
              devices = os.environ.get("CUDA_VISIBLE_DEVICES", None)
              if self.device_count == 0:
                  self.active_devices = list()
              elif devices is not None:
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep
 Core Updates (#1015)

- Remove lib.utils.keras_backend_quiet and replace with get_backend() where relevant
- Document lib.gpu_stats and lib.sys_info
- Remove call to GPUStats.is_plaidml from convert and replace with get_backend()
- lib.gui.menu - typofix 
lib/gpu_stats.py