tf.keras.estimator.model_to_estimator

model_to_estimator(
    keras_model=None,
    keras_model_path=None,
    custom_objects=None,
    model_dir=None,
    config=None
)

Defined in tensorflow/python/keras/_impl/keras/estimator.py.

Constructs an Estimator instance from given keras model.

Args:

  • keras_model: Keras model in memory.
  • keras_model_path: Directory to a keras model on disk.
  • custom_objects: Dictionary for custom objects.
  • model_dir: Directory to save Estimator model parameters, graph and etc.
  • config: Configuration object.

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.