Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

model_to_saved_model

Export to Saved Model format


Description

Export to Saved Model format

Usage

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()


keras

R Interface to 'Keras'

v2.4.0
MIT + file LICENSE
Authors
Daniel Falbel [ctb, cph, cre], JJ Allaire [aut, cph], François Chollet [aut, cph], RStudio [ctb, cph, fnd], Google [ctb, cph, fnd], Yuan Tang [ctb, cph] (<https://orcid.org/0000-0001-5243-233X>), Wouter Van Der Bijl [ctb, cph], Martin Studer [ctb, cph], Sigrid Keydana [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.