# TensorFlow Extended

**TensorFlow Extended（TFX）** 是一个端到端的机器学习平台，基于 [TensorFlow](https://www.edgepedia.org/zh/tensorflow) 构建，由谷歌实现，用于构建和部署生产级机器学习流水线。一条 TFX 流水线由一系列组件构成，这些组件执行生产级机器学习工作流的各项任务，包括数据验证、特征工程、训练、模型分析和推理服务，其设计目标是可扩展的高性能机器学习任务。<sup>[1](https://www.tensorflow.org/tfx/guide?authuser=56)</sup><sup> • </sup><sup>[2](https://research.google/pubs/tfx-a-tensorflow-based-production-scale-machine-learning-platform/)</sup>

| 关键事实 | 详情 |
|---|---|
| 是什么 | 一个基于 TensorFlow 的通用生产级机器学习平台，由谷歌开发并开源发布<sup>[2](https://research.google/pubs/tfx-a-tensorflow-based-production-scale-machine-learning-platform/)</sup><sup> • </sup><sup>[3](https://github.com/tensorflow/tfx/blob/master/README.md)</sup> |
| 内部启动 | 2017 年，距其前身平台 Sibyl（成立于 2007 年）近十年<sup>[4](https://blog.tensorflow.org/2020/09/brief-history-of-tensorflow-extended-tfx.html)</sup> |
| 标准组件 | ExampleGen、StatisticsGen、SchemaGen、ExampleValidator、Transform、Trainer、Tuner、Evaluator 等<sup>[1](https://www.tensorflow.org/tfx/guide?authuser=56)</sup> |
| 编排器 | Apache Airflow、Apache Beam 和 Kubeflow Pipelines<sup>[5](https://www.tensorflow.org/tfx/guide/understanding_tfx_pipelines?authuser=0000)</sup> |
| 元数据 | 组件与一个 ML 元数据后端交互，记录组件运行、输入和输出工件以及运行时配置<sup>[3](https://github.com/tensorflow/tfx/blob/master/README.md)</sup> |
| Google Play 成果 | 上线时间从数月量级缩短至数周，且改进的数据与模型分析使应用安装量提升了 2%<sup>[2](https://research.google/pubs/tfx-a-tensorflow-based-production-scale-machine-learning-platform/)</sup> |
| 发布节奏 | TFX SDK 大约每季度发布一个新的小版本；TFX 1.21.0 是最新版本<sup>[6](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/supported-frameworks?hl=en)</sup><sup> • </sup><sup>[7](https://github.com/tensorflow/tfx/releases)</sup> |

## 目的与起源

TFX 所解决的问题是：要可靠地生产和部署机器学习模型，需要编排许多部件——从训练数据生成模型的学习器、用于分析和验证数据与模型的模块，以及在生产环境中提供模型推理服务的基础设施。当数据随时间变化、必须持续产出新模型时，这种编排往往是用胶水代码和自定义脚本临时拼凑的，导致重复劳动和脆弱的高技术债系统。通过将这些组件集成到一个平台中，TFX 标准化了组件、简化了配置，并将上线时间从数月量级缩短至数周。<sup>[2](https://research.google/pubs/tfx-a-tensorflow-based-production-scale-machine-learning-platform/)</sup>

该平台脱胎于谷歌此前的系统。Sibyl 成立于 2007 年，是一个面向生产用途的大规模机器学习平台；它在生产环境中运行了约 14 年，其绝大多数工作负载已迁移至 TFX。TensorFlow 于 2015 年作为 DistBelief 的继任者公开发布，提供了灵活的编程模型，但缺乏完整的端到端生产系统；而 Sibyl 具备健壮的端到端能力，却缺乏灵活性。TFX 于 2017 年在谷歌内部启动，旨在将两者结合，并在 丹尼斯·贝勒（Denis Baylor）、埃里克·布雷克（Eric Breck）、郑恒泽（Heng-Tze Cheng）及谷歌同事的 KDD 2017 论文中进行了描述。<sup>[4](https://blog.tensorflow.org/2020/09/brief-history-of-tensorflow-extended-tfx.html)</sup><sup> • </sup><sup>[2](https://research.google/pubs/tfx-a-tensorflow-based-production-scale-machine-learning-platform/)</sup>

## TFX 流水线的工作原理

流水线被定义为一个组件序列，每个组件是一个机器学习任务的实现，作为工作流中的一个步骤运行。组件由 TFX 库构建，这些库也可以单独使用。组件实例作为输出产生工件，并消费上游组件的工件，执行顺序由这些工件依赖关系构成的有向无环图决定。<sup>[8](https://www.tensorflow.org/tfx)</sup><sup> • </sup><sup>[9](https://tensorflow.github.io/tfx/guide/build_tfx_pipeline/)</sup>

一条典型流水线包含以下标准组件：<sup>[1](https://www.tensorflow.org/tfx/guide?authuser=56)</sup>

- **ExampleGen**，初始输入组件，摄取输入数据集并可选择拆分，将其格式化为 tf.Examples。
- **StatisticsGen** 计算数据集的统计信息。
- **SchemaGen** 检查统计信息并创建数据模式。
- **ExampleValidator** 查找数据集中的异常和缺失值。
- **Transform** 对数据集执行特征工程。
- **Trainer** 训练模型，**Tuner** 调优其超参数。
- **Evaluator** 对训练结果执行深度分析，并在导出的模型推送到生产之前进行验证。

组件与一个 ML 元数据后端交互，该后端记录组件运行、输入和输出工件以及运行时配置。这一记录支持实验跟踪以及从先前运行热启动或恢复机器学习模型等功能。流水线缓存让一次运行可以跳过已用相同输入集执行过的组件。<sup>[3](https://github.com/tensorflow/tfx/blob/master/README.md)</sup><sup> • </sup><sup>[9](https://tensorflow.github.io/tfx/guide/build_tfx_pipeline/)</sup>

TFX 流水线是机器学习工作流的可移植实现，可以在多种编排器上运行，包括 [Apache Airflow](https://www.edgepedia.org/zh/apache-airflow)、Apache Beam 和 [Kubeflow](https://www.edgepedia.org/zh/kubeflow) Pipelines。在开发阶段，InteractiveContext 让工程师可以在笔记本中逐个运行组件，然后再用运行器部署完整流水线。<sup>[5](https://www.tensorflow.org/tfx/guide/understanding_tfx_pipelines?authuser=0000)</sup><sup> • </sup><sup>[10](https://tensorflow.google.cn/tfx/tutorials?hl=en)</sup>

## 持续训练与部署

由于生产数据随时间变化，TFX 支持持续流水线，随着新数据的到来刷新模型。谷歌在 USENIX OpML 2019 上关于该平台的论文指出，持续流水线无法有效地实现为以固定间隔（例如每 24 小时）重复执行一次性流水线：如果新数据在计划运行之后稍晚出现，产出一个新模型可能超过一个间隔，这在生产中可能不可接受。<sup>[11](https://www.usenix.org/sites/default/files/opml19_full_proceedings.pdf)</sup>

该平台管理向在线、原生移动端和 [JavaScript](https://www.edgepedia.org/zh/javascript) 目标的部署，并原生支持 TensorFlow Lite 进行端侧推理。<sup>[1](https://www.tensorflow.org/tfx/guide?authuser=56)</sup><sup> • </sup><sup>[8](https://www.tensorflow.org/tfx)</sup>

## Google Play 案例研究

KDD 2017 论文展示了 TFX 在 [Google Play](https://www.edgepedia.org/zh/google-play) 应用商店中的部署，其中机器学习模型随新数据的到来持续刷新。TFX 投入生产后，所需的定制代码量下降，实验周期加快，更好的数据与模型分析使应用安装量提升了 2%。<sup>[2](https://research.google/pubs/tfx-a-tensorflow-based-production-scale-machine-learning-platform/)</sup>

## 现状与生态

TFX 是开源的，托管在 tensorflow/tfx 仓库中，其组件和编排器集成可以扩展。谷歌云文档说明的发布节奏是大约每季度发布一个新的 TFX SDK 小版本，只有最新小版本会获得补丁；SDK 1.15 于 2024 年 4 月 29 日发布。该仓库的最新版本 TFX 1.21.0 升级了流水线约束以支持 TensorFlow 2.21.0。<sup>[3](https://github.com/tensorflow/tfx/blob/master/README.md)</sup><sup> • </sup><sup>[6](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/supported-frameworks?hl=en)</sup><sup> • </sup><sup>[7](https://github.com/tensorflow/tfx/releases)</sup> TFX 常被与其他 MLOps 工具如 Kubeflow 和 MLflow 进行比较；相关综述将其归类为专注于机器学习流水线执行，它本身不是编排器，因为 TFX 流水线设计为由 Kubeflow 或 Airflow 等编排器执行。<sup>[12](https://intellerts.com/evaluating-mlops-tools/)</sup><sup> • </sup><sup>[13](https://uplatz.com/blog/architecting-for-velocity-and-resilience-an-analysis-of-automated-model-training-pipelines-in-mlops/)</sup>

## References

1. [The TFX User Guide, TensorFlow](https://www.tensorflow.org/tfx/guide?authuser=56)
2. [TFX: A TensorFlow-Based Production-Scale Machine Learning Platform, Google Research (KDD 2017)](https://research.google/pubs/tfx-a-tensorflow-based-production-scale-machine-learning-platform/)
3. [TFX README, tensorflow/tfx on GitHub](https://github.com/tensorflow/tfx/blob/master/README.md)
4. [Towards ML Engineering: A Brief History Of TensorFlow Extended (TFX), TensorFlow Blog](https://blog.tensorflow.org/2020/09/brief-history-of-tensorflow-extended-tfx.html)
5. [Understanding TFX Pipelines, TensorFlow](https://www.tensorflow.org/tfx/guide/understanding_tfx_pipelines?authuser=0000)
6. [Supported frameworks for pipelines, Google Cloud Documentation](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/supported-frameworks?hl=en)
7. [Releases, tensorflow/tfx on GitHub](https://github.com/tensorflow/tfx/releases)
8. [TFX | ML Production Pipelines, TensorFlow](https://www.tensorflow.org/tfx)
9. [Building TFX pipelines, TFX documentation](https://tensorflow.github.io/tfx/guide/build_tfx_pipeline/)
10. [TFX tutorials, TensorFlow](https://tensorflow.google.cn/tfx/tutorials?hl=en)
11. [Continuous Training for Production ML in the TensorFlow Extended (TFX) Platform, USENIX OpML 2019](https://www.usenix.org/sites/default/files/opml19_full_proceedings.pdf)
12. [Evaluating MLOps Tools, Intellerts](https://intellerts.com/evaluating-mlops-tools/)
13. [Architecting for Velocity and Resilience: An Analysis of Automated Model Training Pipelines in MLOps, Uplatz](https://uplatz.com/blog/architecting-for-velocity-and-resilience-an-analysis-of-automated-model-training-pipelines-in-mlops/)

---
*Initially written Oct 26, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Databases and data systems › Data mining, warehousing, and big data › Big data platforms and frameworks

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/tensorflow-extended

English original: https://www.edgepedia.org/tensorflow-extended
