tfx.v1.components.Pusher

A TFX component to push validated TensorFlow models to a model serving platform.

Inherits From: BaseComponent, BaseNode

Used in the notebooks

Used in the tutorials

The Pusher component can be used to push an validated SavedModel from output of the Trainer component to TensorFlow Serving. The Pusher will check the validation results from the Evaluator component and InfraValidator component before deploying the model. If the model has not been blessed, then the model will not be pushed.

Example

  # Checks whether the model passed the validation steps and pushes the model
  # to a file destination if check passed.
  pusher = Pusher(
      model=trainer.outputs['model'],
      model_blessing=evaluator.outputs['blessing'],
      push_destination=proto.PushDestination(
          filesystem=proto.PushDestination.Filesystem(
              base_directory=serving_model_dir)))

Component outputs contains:

See the Pusher guide for more details.

model An optional BaseChannel of type standard_artifacts.Model, usually produced by a Trainer component.
model_blessing An optional BaseChannel of type standard_artifacts.ModelBlessing, usually produced from an Evaluator component.
infra_blessing An optional BaseChannel of type standard_artifacts.InfraBlessing, usually produced from an InfraValidator component.
push_destination A pusher_pb2.PushDestination instance, providing info for tensorflow serving to load models. Optional if executor_class doesn't require push_destination.
custom_config A dict which contains the deployment job parameters to be passed to Cloud platforms.
custom_executor_spec Optional custom executor spec. Deprecated (no compatibility guarantee), please customize component directly.

outputs Component's output channel dict.

Methods

with_node_execution_options

POST_EXECUTABLE_SPEC None
PRE_EXECUTABLE_SPEC None