model_to_saved_model: Export to Saved Model format

Description Usage Arguments Value Note See Also

View source: R/model-persistence.R

Description

Export to Saved Model format

Usage

1
2
3
4
5
6
7
8
model_to_saved_model(
  model,
  saved_model_path,
  custom_objects = NULL,
  as_text = FALSE,
  input_signature = NULL,
  serving_only = FALSE
)

Arguments

model

A Keras model to be saved. If the model is subclassed, the flag serving_only must be set to TRUE.

saved_model_path

a string specifying the path to the SavedModel directory.

custom_objects

Optional dictionary mapping string names to custom classes or functions (e.g. custom loss functions).

as_text

bool, FALSE by default. Whether to write the SavedModel proto in text format. Currently unavailable in serving-only mode.

input_signature

A possibly nested sequence of tf.TensorSpec objects, used to specify the expected model inputs. See tf.function for more details.

serving_only

bool, FALSE by default. When this is true, only the prediction graph is saved.

Value

Invisibly returns the saved_model_path.

Note

This functionality is experimental and only works with TensorFlow version >= "2.0".

See Also

Other saved_model: model_from_saved_model()


dfalbel/keras documentation built on Nov. 27, 2019, 8:16 p.m.