模型部署与服务:从训练到生产#
模型训练好了,怎么让别人用? 本章从 ONNX 导出到 Ferrinx 部署,打通从训练到生产的最后一公里。
本章概览
章节 |
内容 |
与前面章节的联系 |
|---|---|---|
从训练到生产的完整链路 |
完整训练流程 中的模型 → 这里导出 |
|
PyTorch 模型导出为 ONNX 格式 |
LeNet-5:练习峰首登 的 LeNet → 导出示例 |
|
量化与剪枝:让模型又轻又快 |
导出的 ONNX 模型 → 压缩加速 |
|
模型服务架构设计 |
对比 实验设计 的实验架构 |
|
Ferrinx 服务的部署操作 |
使用训练框架 的框架使用模式 |
|
总结与完整 MLOps 链路 |
串联所有章节 |
学习路径
本章是模型从"实验"到"生产"的最后一公里:
graph LR
A[PyTorch训练<br/>学会训练] --> B[ONNX导出<br/>跨平台格式]
B --> C[模型优化<br/>量化与剪枝]
C --> D[服务架构<br/>同步/异步]
D --> E[部署实践<br/>Ferrinx CLI]
E --> F[生产环境<br/>API服务]
核心认知:模型部署不是训练的附属品,而是让 AI 产生价值的必要环节——没有部署,再高精度的模型也只是实验室的玩具。
前置知识
贡献者与修订历史
查看详细修订记录
-
2af69852026-06-14 - Heyan Zhu: feat(model-serving): add quantization and pruning chapter, restructure for general-first narrative -
dc35df22026-06-14 - Heyan Zhu: refactor: unify into two-chapter mountain-climbing narrative -
f1c39fd2026-05-11 - Heyan Zhu: docs: deduplicate index & introduction; fix the latex export problem on index content structures -
2dc78ed2026-05-09 - Heyan Zhu: fix: address latex errors when building pdf -
f159d562026-05-08 - Heyan Zhu: fix: address complaints from the linter -
bba351e2026-04-29 - Heyan Zhu: docs: update chapter summaries and learning paths for consistency -
0cdb1e42026-04-29 - Heyan Zhu: feat: add model-serving chapter and update related content