message: Deserialization should have custom objects.
diff: @@ -633,21 +633,20 @@ def clone_and_build_model(
  'Error when cloning model: compile_clone was set to True, but the '
  'original model has not been compiled.')
  + with CustomObjectScope(custom_objects or {}):
  if model._is_graph_network or isinstance(model, Sequential):
  - if custom_objects:
  - with CustomObjectScope(custom_objects):
  - clone = clone_model(model, input_tensors=input_tensors)
  - else:
  clone = clone_model(model, input_tensors=input_tensors)
  - if all([isinstance(clone, Sequential),
  - not clone._is_graph_network,
  - getattr(model, '_build_input_shape', None) is not None]):
  + if all([
  + isinstance(clone, Sequential), not clone._is_graph_network,
  + getattr(model, '_build_input_shape', None) is not None
  + ]):
  # Set model inputs to build the model and add input/output properties.
  # TODO(kathywu): Add multiple placeholders to handle edge case where
  # sequential model has multiple inputs.
  clone._set_inputs(
  - K.placeholder(model._build_input_shape, dtype=model.inputs[0].dtype))
  + K.placeholder(
  + model._build_input_shape, dtype=model.inputs[0].dtype))
  else:
  try:
  # Prefer clonining the model if serial/deserial logic is implemented for
  @@ -661,10 +660,10 @@ def clone_and_build_model(
  raise ValueError(
  'This model is a subclassed model. '
  'Such a model cannot be cloned, but there is a workaround where '
  - 'the model is reset in-place. To use this, please set the argument '
  - '`in_place_reset` to `True`. This will reset the attributes in the '
  - 'original model. To restore the attributes, call '
  - '`in_place_subclassed_model_state_restoration(model)`.')
  + 'the model is reset in-place. To use this, please set the '
  + 'argument `in_place_reset` to `True`. This will reset the '
  + 'attributes in the original model. To restore the attributes, '
  + 'call `in_place_subclassed_model_state_restoration(model)`.')
  clone = model
  _in_place_subclassed_model_reset(clone)
  if input_tensors is not None:
  