A TFX component to push validated TensorFlow models to a model serving platform.
Inherits From: BaseComponent
, BaseNode
tfx.v1.components.Pusher(
model: Optional[tfx.v1.types.BaseChannel
] = None,
model_blessing: Optional[tfx.v1.types.BaseChannel
] = None,
infra_blessing: Optional[tfx.v1.types.BaseChannel
] = None,
push_destination: Optional[Union[tfx.v1.proto.PushDestination
, tfx.v1.dsl.experimental.RuntimeParameter
]] = None,
custom_config: Optional[Dict[str, Any]] = None,
custom_executor_spec: Optional[executor_spec.ExecutorSpec] = None
)
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:
pushed_model
: Channel of typestandard_artifacts.PushedModel
with result of push.
See the Pusher guide for more details.
Args | |
---|---|
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. |
Attributes | |
---|---|
outputs
|
Component's output channel dict. |
Methods
with_node_execution_options
with_node_execution_options(
node_execution_options: utils.NodeExecutionOptions
) -> typing_extensions.Self
Class Variables | |
---|---|
POST_EXECUTABLE_SPEC |
None
|
PRE_EXECUTABLE_SPEC |
None
|