message: Remove a tensor_slice_reader warning when using HDF5 in Model.load_weights.
  It may make sense to remove the logged warning entirely, but this change just adds an extra check for the filename.
  Fixes
diff: @@ -1211,7 +1211,7 @@ class Network(base_layer.Layer):
  format.
  ValueError: For invalid/unknown format arguments.
  """
  - filepath_is_h5 = filepath.endswith('.h5') or filepath.endswith('.keras')
  + filepath_is_h5 = _is_hdf5_filepath(filepath)
  if save_format is None:
  if filepath_is_h5:
  save_format = 'h5'
  @@ -1293,6 +1293,9 @@ class Network(base_layer.Layer):
  ImportError: If h5py is not available and the weight file is in HDF5
  format.
  """
  + if _is_hdf5_filepath(filepath):
  + save_format = 'h5'
  + else:
  try:
  pywrap_tensorflow.NewCheckpointReader(filepath)
  save_format = 'tf'
  @@ -1469,6 +1472,10 @@ def get_source_inputs(tensor, layer=None, node_index=None):
  return source_tensors
  +def _is_hdf5_filepath(filepath):
  + return filepath.endswith('.h5') or filepath.endswith('.keras')
  +
  +
  def _make_node_key(layer_name, node_index):
  return layer_name + '_ib-' + str(node_index)
  