tf.keras.estimator.model_to_estimator
Stay organized with collections
Save and categorize content based on your preferences.
Constructs an Estimator
instance from given keras model.
tf.keras.estimator.model_to_estimator(
keras_model=None, keras_model_path=None, custom_objects=None, model_dir=None,
config=None, checkpoint_format='checkpoint'
)
For usage example, please see:
Creating estimators from Keras
Models.
Args |
keras_model
|
A compiled Keras model object. This argument is mutually
exclusive with keras_model_path .
|
keras_model_path
|
Path to a compiled Keras model saved on disk, in HDF5
format, which can be generated with the save() method of a Keras model.
This argument is mutually exclusive with keras_model .
|
custom_objects
|
Dictionary for custom objects.
|
model_dir
|
Directory to save Estimator model parameters, graph, summary
files for TensorBoard, etc.
|
config
|
RunConfig to config Estimator .
|
checkpoint_format
|
Sets the format of the checkpoint saved by the estimator
when training. May be saver or checkpoint , depending on whether to
save checkpoints from tf.compat.v1.train.Saver or tf.train.Checkpoint .
The default is checkpoint . Estimators use name-based tf.train.Saver
checkpoints, while Keras models use object-based checkpoints from
tf.train.Checkpoint . Currently, saving object-based checkpoints from
model_to_estimator is only supported by Functional and Sequential
models.
|
Returns |
An Estimator from given keras model.
|
Raises |
ValueError
|
if neither keras_model nor keras_model_path was given.
|
ValueError
|
if both keras_model and keras_model_path was given.
|
ValueError
|
if the keras_model_path is a GCS URI.
|
ValueError
|
if keras_model has not been compiled.
|
ValueError
|
if an invalid checkpoint_format was given.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-10-01 UTC."],[],[]]