Watch talks from the 2019 TensorFlow Dev Summit Watch now

tff.learning.from_compiled_keras_model

tff.learning.from_compiled_keras_model(
    keras_model,
    dummy_batch
)

Defined in learning/model_utils.py.

Builds a tff.learning.Model for an example mini batch.

Args:

  • keras_model: A tf.keras.Model object that was compiled.
  • dummy_batch: A nested structure of values that are convertible to batched tensors with the same shapes and types as expected by forward_pass(). The values of the tensors are not important and can be filled with any reasonable input value.

Returns:

A tff.learning.Model.

Raises:

  • TypeError: If keras_model is not an instance of tf.keras.Model.
  • ValueError: If keras_model was not compiled.