message: Conditional decode workaround for win
diff: @@ -191,11 +191,13 @@ def load_model_from_hdf5(filepath, custom_objects=None, compile=True): # pylint
  if compile:
  # instantiate optimizer
  training_config = f.attrs.get('training_config')
  + if hasattr(training_config, 'decode'):
  + training_config = training_config.decode('utf-8')
  if training_config is None:
  logging.warning('No training configuration found in the save file, so '
  'the model was *not* compiled. Compile it manually.')
  return model
  - training_config = json_utils.decode(training_config.decode('utf-8'))
  + training_config = json_utils.decode(training_config)
  # Compile model.
  model.compile(**saving_utils.compile_args_from_training_config(
  @@ -661,11 +663,15 @@ def load_weights_from_hdf5_group(f, layers):
  and weights file.
  """
  if 'keras_version' in f.attrs:
  - original_keras_version = f.attrs['keras_version'].decode('utf8')
  + original_keras_version = f.attrs['keras_version']
  + if hasattr(original_keras_version, 'decode'):
  + original_keras_version = original_keras_version.decode('utf8')
  else:
  original_keras_version = '1'
  if 'backend' in f.attrs:
  - original_backend = f.attrs['backend'].decode('utf8')
  + original_backend = f.attrs['backend']
  + if hasattr(original_backend, 'decode'):
  + original_backend = original_backend.decode('utf8')
  else:
  original_backend = None
  @@ -732,11 +738,14 @@ def load_weights_from_hdf5_group_by_name(
  and weights file and skip_match=False.
  """
  if 'keras_version' in f.attrs:
  - original_keras_version = f.attrs['keras_version'].decode('utf8')
  + original_keras_version = f.attrs['keras_version']
  + if hasattr(original_keras_version, 'decode'):
  + original_keras_version = original_keras_version.decode('utf8')
  else:
  original_keras_version = '1'
  if 'backend' in f.attrs:
  - original_backend = f.attrs['backend'].decode('utf8')
  + if hasattr(original_backend, 'decode'):
  + original_backend = original_backend.decode('utf8')
  else:
  original_backend = None
  