NNAPI 迁移指南
通过收藏整理内容 根据您的偏好保存和分类内容。
Neural Networks API (NNAPI) 已弃用。它在 Android 8.1 中推出,旨在为设备端机器学习的硬件加速推理提供统一接口,并在 Android 15 中弃用。
NNAPI 发布后,设备端机器学习 (ODML) 领域飞速发展。Transformer 和 Diffusion 等突破性模型,以及该领域的高创新率,意味着开发者需要频繁更新的工具和基础设施。
为了满足这些需求,Google 开发了 Play Services 中的 TensorFlow Lite,为自定义设备端机器学习模型提供了可更新的 TensorFlow 运行时;以及 AICore,它直接在 Android 设备上提供 Gemini Nano 等 GenAI 基础模型。为了更清晰地说明 Android 上生产级机器学习的推荐路径,NNAPI(Neural Networks API)已被弃用。
要从 NNAPI 迁移,请参阅 Google Play Services 中的 TensorFlow Lite 说明,并可选地参阅 TFLite GPU 委托以实现硬件加速。
本页面上的内容和代码示例受内容许可中描述的许可协议约束。Java 和 OpenJDK 是 Oracle 和/或其关联公司的商标或注册商标。
最后更新时间:2025-04-07 UTC。
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-07 UTC."],[],[]]