Thành phần đường ống Pusher TFX
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Thành phần Pusher được sử dụng để đẩy mô hình đã được xác thực đến mục tiêu triển khai trong quá trình đào tạo hoặc đào tạo lại mô hình. Trước khi triển khai, Pusher dựa vào một hoặc nhiều sự hỗ trợ từ các thành phần xác thực khác để quyết định có nên đẩy mô hình hay không.
- Người đánh giá khen ngợi mô hình nếu mô hình được đào tạo mới "đủ tốt" để được đưa vào sản xuất.
- (Tùy chọn nhưng được khuyến nghị) InfraValidator hỗ trợ mô hình nếu mô hình có thể phục vụ được về mặt cơ học trong môi trường sản xuất.
Thành phần Pusher sử dụng mô hình được đào tạo ở định dạng SavingModel và tạo ra SavingModel tương tự, cùng với siêu dữ liệu phiên bản.
Sử dụng thành phần Pusher
Thành phần đường dẫn Pusher thường rất dễ triển khai và yêu cầu ít tùy chỉnh vì tất cả công việc đều được thực hiện bởi thành phần Pusher TFX. Mã điển hình trông như thế này:
pusher = Pusher(
model=trainer.outputs['model'],
model_blessing=evaluator.outputs['blessing'],
infra_blessing=infra_validator.outputs['blessing'],
push_destination=tfx.proto.PushDestination(
filesystem=tfx.proto.PushDestination.Filesystem(
base_directory=serving_model_dir)
)
)
Đẩy một mô hình được tạo từ InfraValidator.
(Từ phiên bản 0.30.0)
InfraValidator cũng có thể tạo ra tạo phẩm InfraBlessing
chứa một mô hình có phần khởi động và Pusher có thể đẩy nó giống như một tạo phẩm Model
.
infra_validator = InfraValidator(
...,
# make_warmup=True will produce a model with warmup requests in its
# 'blessing' output.
request_spec=tfx.proto.RequestSpec(..., make_warmup=True)
)
pusher = Pusher(
# Push model from 'infra_blessing' input.
infra_blessing=infra_validator.outputs['blessing'],
push_destination=tfx.proto.PushDestination(...)
)
Thông tin chi tiết hơn có sẵn trong tài liệu tham khảo API Pusher .
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],[],null,["# The Pusher TFX Pipeline Component\n\n\u003cbr /\u003e\n\nThe Pusher component is used to push a validated model to a\n[deployment target](/tfx/guide#deployment_targets) during model training or\nre-training. Before the deployment, Pusher relies on one or more blessings from\nother validation components to decide whether to push the model or not.\n\n- [Evaluator](/tfx/guide/evaluator) blesses the model if the new trained model is \"good enough\" to be pushed to production.\n- (Optional but recommended) [InfraValidator](/tfx/guide/infra_validator) blesses the model if the model is mechanically servable in a production environment.\n\nA Pusher component consumes a trained model in [SavedModel](/guide/saved_model)\nformat, and produces the same SavedModel, along with versioning metadata.\n\nUsing the Pusher Component\n--------------------------\n\nA Pusher pipeline component is typically very easy to deploy and requires little\ncustomization, since all of the work is done by the Pusher TFX component.\nTypical code looks like this: \n\n pusher = Pusher(\n model=trainer.outputs['model'],\n model_blessing=evaluator.outputs['blessing'],\n infra_blessing=infra_validator.outputs['blessing'],\n push_destination=tfx.proto.PushDestination(\n filesystem=tfx.proto.PushDestination.Filesystem(\n base_directory=serving_model_dir)\n )\n )\n\n### Pushing a model produced from InfraValidator.\n\n(From version 0.30.0)\n\nInfraValidator can also produce `InfraBlessing` artifact containing a\n[model with warmup](/tfx/guide/infra_validator#producing_a_savedmodel_with_warmup), and\nPusher can push it just like a `Model` artifact. \n\n infra_validator = InfraValidator(\n ...,\n # make_warmup=True will produce a model with warmup requests in its\n # 'blessing' output.\n request_spec=tfx.proto.RequestSpec(..., make_warmup=True)\n )\n\n pusher = Pusher(\n # Push model from 'infra_blessing' input.\n infra_blessing=infra_validator.outputs['blessing'],\n push_destination=tfx.proto.PushDestination(...)\n )\n\nMore details are available in the\n[Pusher API reference](https://www.tensorflow.org/tfx/api_docs/python/tfx/v1/components/Pusher)."]]