[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-apple--coremltools":3,"tool-apple--coremltools":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":17},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[14,15,13,52],"视频",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[14,35],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":77,"owner_email":77,"owner_twitter":77,"owner_website":78,"owner_url":79,"languages":80,"stars":119,"forks":120,"last_commit_at":121,"license":122,"difficulty_score":92,"env_os":123,"env_gpu":124,"env_ram":124,"env_deps":125,"category_tags":135,"github_topics":136,"view_count":32,"oss_zip_url":77,"oss_zip_packed_at":77,"status":17,"created_at":143,"updated_at":144,"faqs":145,"releases":174},4238,"apple\u002Fcoremltools","coremltools","Core ML tools contain supporting tools for Core ML model conversion, editing, and validation.","coremltools 是苹果官方推出的 Python 工具包，旨在帮助开发者将各类机器学习模型无缝转换为 Core ML 格式，以便在 iOS、macOS 等苹果设备上高效运行。它主要解决了不同训练框架与苹果生态系统之间的兼容性问题，让原本基于 TensorFlow、PyTorch、scikit-learn 或 XGBoost 等主流库训练的模型，能够轻松迁移到移动端。\n\n这款工具特别适合苹果生态的应用开发者和机器学习研究人员使用。通过 coremltools，用户不仅可以完成模型格式的转换，还能对模型进行读取、编辑、优化以及在 macOS 上进行预测验证，确保转换后的模型性能符合预期。其独特的技术亮点在于支持广泛的第三方框架，并提供了统一的模型表示形式，使得模型在设备端利用 CPU、GPU 和神经网络引擎进行加速成为可能，同时最大限度地降低内存占用和功耗。\n\n更重要的是，借助 coremltools 转换后的模型完全在用户设备本地运行，无需网络连接，既保护了用户隐私，又提升了应用的响应速度。配合 Xcode，开发者可以快速将优化后的模型集成到自己的 App 中，实现智能化的功能扩展","coremltools 是苹果官方推出的 Python 工具包，旨在帮助开发者将各类机器学习模型无缝转换为 Core ML 格式，以便在 iOS、macOS 等苹果设备上高效运行。它主要解决了不同训练框架与苹果生态系统之间的兼容性问题，让原本基于 TensorFlow、PyTorch、scikit-learn 或 XGBoost 等主流库训练的模型，能够轻松迁移到移动端。\n\n这款工具特别适合苹果生态的应用开发者和机器学习研究人员使用。通过 coremltools，用户不仅可以完成模型格式的转换，还能对模型进行读取、编辑、优化以及在 macOS 上进行预测验证，确保转换后的模型性能符合预期。其独特的技术亮点在于支持广泛的第三方框架，并提供了统一的模型表示形式，使得模型在设备端利用 CPU、GPU 和神经网络引擎进行加速成为可能，同时最大限度地降低内存占用和功耗。\n\n更重要的是，借助 coremltools 转换后的模型完全在用户设备本地运行，无需网络连接，既保护了用户隐私，又提升了应用的响应速度。配合 Xcode，开发者可以快速将优化后的模型集成到自己的 App 中，实现智能化的功能扩展。无论是希望提升应用智能体验的开发者，还是需要将研究成果落地的研究人员，coremltools 都是一个实用且强大的桥梁工具。","[![Build Status](https:\u002F\u002Fimg.shields.io\u002Fgitlab\u002Fpipeline\u002Fcoremltools1\u002Fcoremltools\u002Fmain)](https:\u002F\u002Fgitlab.com\u002Fcoremltools1\u002Fcoremltools\u002F-\u002Fpipelines?page=1&scope=branches&ref=main)\n[![PyPI Release](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fcoremltools.svg)](#)\n[![Python Versions](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fpyversions\u002Fcoremltools.svg)](#)\n\n[Core ML Tools](https:\u002F\u002Fapple.github.io\u002Fcoremltools\u002Fdocs-guides\u002Fsource\u002Foverview-coremltools.html)\n=======================\n\n![Core ML Tools logo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fapple_coremltools_readme_97af500352b8.png)\n\nUse [Core ML Tools](https:\u002F\u002Fapple.github.io\u002Fcoremltools\u002Fdocs-guides\u002Fsource\u002Foverview-coremltools.html) (*coremltools*) to convert machine learning models from third-party libraries to the Core ML format. This Python package contains the supporting tools for converting models from training libraries such as the following:\n\n* [TensorFlow 1.x](https:\u002F\u002Fwww.tensorflow.org\u002Fversions\u002Fr1.15\u002Fapi_docs\u002Fpython\u002Ftf)\n* [TensorFlow 2.x](https:\u002F\u002Fwww.tensorflow.org\u002Fapi_docs)\n* [PyTorch](https:\u002F\u002Fpytorch.org\u002F)\n* Non-neural network frameworks:\n\t* [scikit-learn](https:\u002F\u002Fscikit-learn.org\u002Fstable\u002F)\n\t* [XGBoost](https:\u002F\u002Fxgboost.readthedocs.io\u002Fen\u002Flatest\u002F)\n\t* [LibSVM](https:\u002F\u002Fwww.csie.ntu.edu.tw\u002F~cjlin\u002Flibsvm\u002F)\n\nWith coremltools, you can:\n\n* Convert trained models to the Core ML format.\n* Read, write, and optimize Core ML models.\n* Verify conversion\u002Fcreation (on macOS) by making predictions using Core ML.\n\nAfter conversion, you can integrate the Core ML models with your app using Xcode.\n\n## Install Version 8.3\nTo install the latest non-beta version, run the following command in your terminal:\n```shell\npip install -U coremltools\n```\n\n## Install 9.0 Beta 1\n\nThe [Coremltools version 9 beta 1](https:\u002F\u002Fgithub.com\u002Fapple\u002Fcoremltools\u002Freleases\u002Ftag\u002F9.0b1) is now out. To install, run the following command in your terminal:\n```shell\npip install coremltools==9.0b1\n```\n\n## Core ML\n\n[Core ML](https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fcoreml) is an Apple framework to integrate machine learning models into your app. Core ML provides a unified representation for all models. Your app uses Core ML APIs and user data to make predictions, and to fine-tune models, all on the user’s device. Core ML optimizes on-device performance by leveraging the CPU, GPU, and Neural Engine while minimizing its memory footprint and power consumption. Running a model strictly on the user’s device removes any need for a network connection, which helps keep the user’s data private and your app responsive.\n\n## Resources\n\nTo install coremltools, see [Installing Core ML Tools](https:\u002F\u002Fapple.github.io\u002Fcoremltools\u002Fdocs-guides\u002Fsource\u002Finstalling-coremltools.html). For more information, see the following:\n\n* [Release Notes](https:\u002F\u002Fgithub.com\u002Fapple\u002Fcoremltools\u002Freleases\u002F)\n* [Guide and examples](https:\u002F\u002Fapple.github.io\u002Fcoremltools\u002Fdocs-guides\u002Findex.html)\n* [API Reference](https:\u002F\u002Fapple.github.io\u002Fcoremltools\u002Findex.html)\n* [Core ML Specification](https:\u002F\u002Fapple.github.io\u002Fcoremltools\u002Fmlmodel\u002Findex.html)\n* [Building from Source](BUILDING.md)\n* [Contribution Guidelines](CONTRIBUTING.md)\n","[![构建状态](https:\u002F\u002Fimg.shields.io\u002Fgitlab\u002Fpipeline\u002Fcoremltools1\u002Fcoremltools\u002Fmain)](https:\u002F\u002Fgitlab.com\u002Fcoremltools1\u002Fcoremltools\u002F-\u002Fpipelines?page=1&scope=branches&ref=main)\n[![PyPI 发布](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fcoremltools.svg)](#)\n[![Python 版本](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fpyversions\u002Fcoremltools.svg)](#)\n\n[Core ML 工具](https:\u002F\u002Fapple.github.io\u002Fcoremltools\u002Fdocs-guides\u002Fsource\u002Foverview-coremltools.html)\n=======================\n\n![Core ML 工具标志](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fapple_coremltools_readme_97af500352b8.png)\n\n使用 [Core ML 工具](https:\u002F\u002Fapple.github.io\u002Fcoremltools\u002Fdocs-guides\u002Fsource\u002Foverview-coremltools.html)（*coremltools*）将第三方库中的机器学习模型转换为 Core ML 格式。这个 Python 包包含用于从以下训练库中转换模型的支持工具：\n\n* [TensorFlow 1.x](https:\u002F\u002Fwww.tensorflow.org\u002Fversions\u002Fr1.15\u002Fapi_docs\u002Fpython\u002Ftf)\n* [TensorFlow 2.x](https:\u002F\u002Fwww.tensorflow.org\u002Fapi_docs)\n* [PyTorch](https:\u002F\u002Fpytorch.org\u002F)\n* 非神经网络框架：\n\t* [scikit-learn](https:\u002F\u002Fscikit-learn.org\u002Fstable\u002F)\n\t* [XGBoost](https:\u002F\u002Fxgboost.readthedocs.io\u002Fen\u002Flatest\u002F)\n\t* [LibSVM](https:\u002F\u002Fwww.csie.ntu.edu.tw\u002F~cjlin\u002Flibsvm\u002F)\n\n借助 coremltools，您可以：\n\n* 将训练好的模型转换为 Core ML 格式。\n* 读取、写入和优化 Core ML 模型。\n* 在 macOS 上通过使用 Core ML 进行预测来验证转换或创建过程。\n\n转换完成后，您可以通过 Xcode 将 Core ML 模型集成到您的应用中。\n\n## 安装 8.3 版\n要安装最新的非测试版，请在终端中运行以下命令：\n```shell\npip install -U coremltools\n```\n\n## 安装 9.0 测试版 1\n\n[Coremltools 9.0 测试版 1](https:\u002F\u002Fgithub.com\u002Fapple\u002Fcoremltools\u002Freleases\u002Ftag\u002F9.0b1) 现已发布。要安装，请在终端中运行以下命令：\n```shell\npip install coremltools==9.0b1\n```\n\n## Core ML\n\n[Core ML](https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fcoreml) 是 Apple 提供的一个框架，用于将机器学习模型集成到您的应用中。Core ML 为所有模型提供统一的表示形式。您的应用可以使用 Core ML API 和用户数据进行预测，并在用户的设备上对模型进行微调。Core ML 通过利用 CPU、GPU 和神经引擎来优化设备端性能，同时最大限度地减少内存占用和功耗。将模型完全在用户设备上运行，无需任何网络连接，这有助于保护用户数据隐私并保持应用的响应速度。\n\n## 资源\n\n要安装 coremltools，请参阅 [安装 Core ML 工具](https:\u002F\u002Fapple.github.io\u002Fcoremltools\u002Fdocs-guides\u002Fsource\u002Finstalling-coremltools.html)。更多信息请参见以下内容：\n\n* [发行说明](https:\u002F\u002Fgithub.com\u002Fapple\u002Fcoremltools\u002Freleases\u002F)\n* [指南和示例](https:\u002F\u002Fapple.github.io\u002Fcoremltools\u002Fdocs-guides\u002Findex.html)\n* [API 参考](https:\u002F\u002Fapple.github.io\u002Fcoremltools\u002Findex.html)\n* [Core ML 规范](https:\u002F\u002Fapple.github.io\u002Fcoremltools\u002Fmlmodel\u002Findex.html)\n* [从源代码构建](BUILDING.md)\n* [贡献指南](CONTRIBUTING.md)","# Core ML Tools 快速上手指南\n\nCore ML Tools (`coremltools`) 是 Apple 官方提供的 Python 工具包，用于将第三方机器学习框架（如 TensorFlow、PyTorch、scikit-learn 等）训练的模型转换为苹果生态专用的 **Core ML** 格式，以便在 iOS、macOS、watchOS 和 tvOS 应用中高效运行。\n\n## 环境准备\n\n*   **操作系统**：推荐在 macOS 上进行模型验证和最终集成（需安装 Xcode），但模型转换过程可在 Linux、Windows 或 macOS 上完成。\n*   **Python 版本**：支持 Python 3.7 及以上版本（具体支持版本请参考 PyPI 页面）。\n*   **前置依赖**：\n    *   已训练好的模型文件（例如 `.h5`, `.pt`, `.pkl` 等）。\n    *   对应的原始深度学习框架（如 `tensorflow`, `torch`, `scikit-learn` 等）需预先安装。\n\n## 安装步骤\n\n### 1. 使用国内镜像源加速安装（推荐）\n在中国大陆地区，建议使用清华或阿里云镜像源以提升下载速度。\n\n**安装最新稳定版 (v8.3)：**\n```shell\npip install -U coremltools -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n**安装 Beta 测试版 (v9.0b1)：**\n如需体验最新特性（注意可能存在不稳定性），可安装 Beta 版本：\n```shell\npip install coremltools==9.0b1 -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n### 2. 验证安装\n安装完成后，可通过以下命令检查版本：\n```shell\npython -c \"import coremltools; print(coremltools.__version__)\"\n```\n\n## 基本使用\n\n以下示例展示如何将一个预训练的 **TensorFlow\u002FKeras** 模型转换为 Core ML 格式。其他框架（如 PyTorch）流程类似，只需更改加载模型和转换的 API。\n\n### 最简单的转换示例\n\n假设你有一个名为 `my_model.h5` 的 Keras 模型文件：\n\n```python\nimport coremltools as ct\nfrom tensorflow import keras\n\n# 1. 加载已训练的模型 (以 Keras 为例)\nkeras_model = keras.models.load_model('my_model.h5')\n\n# 2. 转换为 Core ML 模型\n# input_names 和 output_names 可根据需要自定义\nmlmodel = ct.convert(\n    keras_model,\n    inputs=[ct.ImageType(shape=(1, 224, 224, 3), bias=[-1,-1,-1], scale=1\u002F127.5)],\n    convert_to=\"mlprogram\" # 推荐使用新一代 mlprogram 格式\n)\n\n# 3. 保存为 .mlmodel 或 .mlpackage 文件\nmlmodel.save(\"MyConvertedModel.mlpackage\")\n\nprint(\"转换成功！文件已保存为 MyConvertedModel.mlpackage\")\n```\n\n### 后续步骤\n转换生成的 `.mlpackage` 文件可直接拖入 **Xcode** 项目中。在 macOS 上，你还可以使用 `coremltools` 进行预测验证：\n\n```python\n# 仅在 macOS 上支持直接预测验证\nfrom PIL import Image\nimport numpy as np\n\n# 加载测试图片\nimg = Image.open('test_image.jpg').resize((224, 224))\ninput_data = np.array(img)\n\n# 执行预测\nprediction = mlmodel.predict({'image': input_data})\nprint(prediction)\n```\n\n> **提示**：转换后的模型需通过 Xcode 集成到 App 中，利用 Core ML 框架调用 CPU、GPU 或 Neural Engine 进行本地推理，确保用户数据隐私并降低延迟。","某医疗科技团队开发了一款基于 PyTorch 的皮肤病变识别模型，希望将其集成到 iOS 端的医生辅助诊断 App 中，以实现离线实时检测。\n\n### 没有 coremltools 时\n- **格式壁垒高**：PyTorch 训练的 `.pt` 模型无法直接被 Xcode 识别，团队需手动重写模型结构或寻找不稳定的第三方转换脚本。\n- **隐私与延迟风险**：因无法在端侧运行，被迫将图片上传至云端推理，不仅增加网络延迟，还违反患者数据不出设备的合规要求。\n- **性能优化缺失**：缺乏针对 Apple 芯片（CPU\u002FGPU\u002F神经引擎）的自动优化手段，导致旧款 iPhone 上推理速度缓慢且耗电严重。\n- **验证流程繁琐**：无法在 macOS 本地直接验证转换后的模型精度，必须反复打包真机测试，调试周期长达数天。\n\n### 使用 coremltools 后\n- **一键无缝转换**：通过 `coremltools.convert()` 接口，几行代码即可将 PyTorch 模型高精度转换为 `.mlmodel` 格式，直接拖入 Xcode 工程。\n- **端侧私有部署**：模型完全运行在医生手机本地，无需联网即可毫秒级输出诊断结果，彻底保障患者隐私并提升响应速度。\n- **硬件自动加速**：coremltools 自动量化模型并利用神经引擎加速，在降低内存占用的同时，使推理速度提升 3 倍以上。\n- **本地即时验证**：支持在 macOS 上直接加载转换后的模型进行预测比对，确保精度无损后再集成，将调试时间缩短至小时级。\n\ncoremltools 打通了从算法训练到苹果生态落地的“最后一公里”，让复杂的深度学习模型能安全、高效地运行在每一位用户的口袋中。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fapple_coremltools_97af5003.png","apple","Apple","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fapple_84e0ff25.jpg","",null,"https:\u002F\u002Fapple.com","https:\u002F\u002Fgithub.com\u002Fapple",[81,85,89,93,97,101,105,108,112,116],{"name":82,"color":83,"percentage":84},"Python","#3572A5",83.4,{"name":86,"color":87,"percentage":88},"C++","#f34b7d",13.7,{"name":90,"color":91,"percentage":92},"Swift","#F05138",1,{"name":94,"color":95,"percentage":96},"C","#555555",0.7,{"name":98,"color":99,"percentage":100},"Objective-C++","#6866fb",0.6,{"name":102,"color":103,"percentage":104},"CMake","#DA3434",0.2,{"name":106,"color":107,"percentage":104},"Shell","#89e051",{"name":109,"color":110,"percentage":111},"Objective-C","#438eff",0.1,{"name":113,"color":114,"percentage":115},"Makefile","#427819",0,{"name":117,"color":118,"percentage":115},"Mustache","#724b3b",5216,771,"2026-04-05T22:57:16","BSD-3-Clause","macOS, Linux, Windows","未说明",{"notes":126,"python":127,"dependencies":128},"该工具主要用于将第三方机器学习模型转换为 Apple Core ML 格式。虽然转换过程可在多平台进行，但 README 明确指出‘验证转换\u002F创建（在 macOS 上）’的功能依赖于 macOS 环境。转换后的模型需通过 Xcode 集成到应用中，因此最终部署目标通常为 Apple 生态系统（iOS, macOS, watchOS, tvOS）。","3.7+",[129,130,131,132,133,134],"TensorFlow 1.x","TensorFlow 2.x","PyTorch","scikit-learn","XGBoost","LibSVM",[14],[64,137,138,139,140,141,142],"tensorflow","pytorch","coreml","machine-learning","model-converter","model-conversion","2026-03-27T02:49:30.150509","2026-04-06T15:01:35.956175",[146,151,156,161,166,170],{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},19302,"为什么在调用 model.predict 时抛出 'Unable to load CoreML.framework' 异常？","这通常是因为 Python 版本不兼容或安装不完整导致的。Core ML Tools 可能尚未支持您使用的 Python 版本（例如 Python 3.9），或者在安装过程中构建 `libcoremlpython` 失败。建议尝试使用受支持的 Python 版本（如 Python 3.8）重新安装，并确保使用 wheel 包而不是 egg 包进行安装。如果问题依旧，请检查安装日志中是否有编译错误。","https:\u002F\u002Fgithub.com\u002Fapple\u002Fcoremltools\u002Fissues\u002F372",{"id":152,"question_zh":153,"answer_zh":154,"source_url":155},19303,"如何在设备上训练模型时解决 'std::runtime_error: BNNS error' 崩溃问题？","该错误通常发生在尝试使用 MLUpdateTask 进行设备端训练时。虽然具体原因可能因模型而异，但已知通过参考官方示例（如 Emoji 绘图示例）并确保模型转换脚本正确启用了可训练参数可以解决部分问题。如果问题持续，建议创建一个最小化复现案例，确认输入数据格式（如 MLMultiArray）和标签格式是否正确，并检查是否使用了不支持的层类型。","https:\u002F\u002Fgithub.com\u002Fapple\u002Fcoremltools\u002Fissues\u002F490",{"id":157,"question_zh":158,"answer_zh":159,"source_url":160},19304,"转换 PyTorch 模型时遇到 'PyTorch convert function for op fft_rfftn not implemented' 错误怎么办？","Core ML Tools 目前未直接实现 `fft_rfftn` 算子。由于 PyTorch 的 `rfft2` 是 `rfftn` 的特例，建议尝试在模型中将 `rfft2` 替换为 `rfftn` 看是否能绕过问题。如果仍然报错（例如涉及 `view_as_complex` 等操作），可能需要自定义算子注册或等待官方支持。若必须支持该算子，可参考相关 PR 提交代码贡献或开启新 Issue 提供复现代码。","https:\u002F\u002Fgithub.com\u002Fapple\u002Fcoremltools\u002Fissues\u002F1311",{"id":162,"question_zh":163,"answer_zh":164,"source_url":165},19305,"保存设备端更新后的模型时失败，提示 'Failed to save model' 且错误代码为 6，如何解决？","此错误常见于保存包含无偏置项（bias）的密集层（dense layer）的模型。如果遇到该问题，请检查模型结构中是否存在没有 bias 的全连接层。如果是这种情况，属于已知限制，建议修改模型结构为包含 bias 的层，或向官方提交 Bug 报告。此外，确保目标目录具有写入权限，且路径合法。","https:\u002F\u002Fgithub.com\u002Fapple\u002Fcoremltools\u002Fissues\u002F431",{"id":167,"question_zh":168,"answer_zh":169,"source_url":150},19306,"Core ML Tools 是否支持 Python 3.9？","在早期版本中，Core ML Tools 不支持 Python 3.9，会导致无法加载 CoreML.framework 等错误。建议使用 Python 3.8 以确保兼容性。不过，Core ML Tools 5 beta 版本已开始支持 Python 3.9 及以上版本，如需使用新版 Python，请升级至 coremltools 5 beta 或更高版本。",{"id":171,"question_zh":172,"answer_zh":173,"source_url":155},19307,"如何将 TensorFlow Keras 模型转换为可在 iOS 设备上进行个性化训练的 Core ML 模型？","首先使用 CreateML 或 coremltools 将 Keras 模型转换为 Core ML 格式，并在转换时启用训练选项（updatable=True）。然后在 Xcode 中检查模型是否显示可更新参数。在代码中使用 MLUpdateTask 进行训练时，需确保输入数据格式（如 MLMultiArray）与模型定义一致，并正确处理标签数据。若出现 BNNS 错误，请参考官方示例验证流程，并确认模型层类型是否全部支持设备端训练。",[175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270],{"id":176,"version":177,"summary_zh":178,"released_at":179},117278,"9.0","与 8.3.0 版本相比（包括 9.0b1 中的功能）\n\n* 新增对 Python 3.13 的支持。\n* 修复了与 `upsample_bilinear` 相关的 bug。\n* 修复了符号形状和动态形状下 `broadcast_to` 的降级问题。\n* 支持使用 `int8` 数据类型作为模型的输入和输出。\n* 增加了读取和写入模型状态的功能。\n* 支持 `iOS26`\u002F`macOS26`\u002F`watchOS26`\u002F`tvOS26` 部署目标。\n* 添加了 `AllowLowPrecisionAccumulationOnGPU` 优化提示。\n* 支持 PyTorch 2.7 和 ExecuTorch 0.5。\n* 自动为转换后的模型添加更多元数据。\n* 优化了 PyTorch 的 `im2col` 操作。\n* 其他多项 bug 修复、功能增强、代码清理和性能优化。\n\n\n特别感谢本次发布中的外部贡献者：\n@orena1 , @M-Quadra, @noobsiecoder, @metascroy, @hasn77, @Pranaykarvi","2025-11-10T22:22:40",{"id":181,"version":182,"summary_zh":183,"released_at":184},117279,"9.0b1","* 支持使用 int8 数据类型进行模型输入输出\n* 能够读取和写入模型状态\n* iOS 26 \u002F macOS 26 \u002F watchOS 26 \u002F tvOS 26 部署目标\n* AllowLowPrecisionAccumulationOnGPU 优化提示\n* 支持 PyTorch 2.7 和 ExecuTorch 0.5\n* 自动为转换后的模型添加额外元数据\n* 优化了 PyTorch 的 `im2col` 操作\n* 各种其他错误修复、功能增强、代码清理和性能优化\n\n\n特别感谢本次发布中的外部贡献者：@pchen7e2、@GameRoMan、@tritolol、@james-p-xu、@M-Quadra、@reneleonhardt、@kasper0406","2025-07-28T16:59:49",{"id":186,"version":187,"summary_zh":188,"released_at":189},117280,"8.3","* 提供[调试与性能工具](https:\u002F\u002Fapple.github.io\u002Fcoremltools\u002Fdocs-guides\u002Fsource\u002Fmlmodel-debugging-perf-utilities.html)，用于定位数值问题和性能瓶颈的根本原因。\n    * MLModelValidator：\n        * 辅助工具，帮助查找产生 NaN、无穷大或满足自定义验证逻辑的有问题算子。\n    * MLModelComparator | TorchScriptMLModelComparator | TorchExportMLModelComparator：\n        * 轻松比较两个 CoreML 模型，或将 CoreML 模型与 PyTorch 模型进行对比。\n        * 在排查数值差异时尤为有用：\n            * 例如 CoreML 模型的 fp16 和 fp32 变体之间的差异；\n            * 或同一 CoreML 模型在不同计算引擎上的表现差异。\n    * MLModelInspector：\n        * 支持获取 CoreML 模型的中间张量。\n    * MLModelBenchmarker | TorchMLModelBenchmarker：\n        * 用于记录模型加载时间、预测延迟以及各操作的执行时间。\n        * 将这些信息与 PyTorch 模块关联起来，从而识别出运行较慢的 PyTorch 模块或节点。\n    * Remote Device：\n        * 用于在已连接设备上对模型进行基准测试和\u002F或调试的工具。\n        * 可与 MLModelBenchmarker、MLModelInspector、MLModelValidator 和 MLModelComparator 等工具无缝协作。\n        * 支持 iOS、macOS、watchOS 和 tvOS 设备。\n\n* 各种其他错误修复、功能增强、代码清理和优化\n    * 支持灰度图像的 Uint8 格式。\n    * 新增对以下 PyTorch 操作的支持：linalg.vecdot、pow、argmin。\n    * 修复了 batch_norm、ConvTranspose1d 和 randn 的降级实现中的问题。\n    * 提升了 top-k 操作在 ANE 上的驻留效率。\n    * 改进了 PTQ API 部署目标相关的错误处理。\n    * 修复了 fp16 神经网络模型权重量化中的缺陷。\n    * 修正了压缩传递的注册问题。\n    * 在 XGBoost 模型转换过程中，更好地处理特征名称。\n\n* 特别感谢第三方开发者：@RGooBS24、@M-Quadra、@smpanaro、@Zerui18、@yushangdi、@lkb85、@Pranaykarvi、@billmguo、@metascroy、@benoit-vinsonneau、@ccyoyou、@reneleonhardt！！","2025-04-29T03:56:01",{"id":191,"version":192,"summary_zh":193,"released_at":194},117281,"8.2","* 增强对 torch.export 导出模型的转换支持覆盖范围\n    * 已覆盖所有常用算子，与我们成熟的 torch.jit.trace 转换器相比，兼容性达到 83%\n    * 新增支持一个模型：torchaudio wav2vec\n* 引入一个新的 Transformers 图优化 pass “common::scaled_dot_product_attention_sliced_q”，以提升长序列长度下 SDPA 计算的性能（例如 Depth-Anything 模型，序列长度为 1814，在应用该图优化 pass 后，在 ANE 上运行时速度提升了 34%，内存占用减少了 45%）\n* 新增支持的 Torch 算子\n    * native_group_norm\n    * bool 类型的 triu\n* 修复了若干 bug\n    * torch.linspace 的行为不正确\n    * 当幂次指数为张量时，power 2 - sqrt 融合出现错误\n\n特别感谢本次发布中的开源社区贡献者：@RGooBS24 @fukatani @twoertwein @kasper0406","2025-01-22T03:00:48",{"id":196,"version":197,"summary_zh":198,"released_at":199},117282,"8.1","## 发行说明\n* Python 支持\n    * 兼容 Python 3.12。\n* 增加了对更多 PyTorch 操作的支持\n    * 现在支持 `torch.clamp_max`、`torch.rand_like`、`torch.all`、`torch.linalg_inv`、`torch.nan_to_num`、`torch.cumprod` 和 `torch.searchsorted` 等操作。\n* 提高了对 `torch.export` 生成模型的转换支持覆盖率\n    * 操作转换支持已达到与我们成熟的 `torch.jit.trace` 转换器 68% 的一致水平。\n    * 支持枚举形状模型。\n    * 支持 `ImageType` 输入。\n* 为以下类添加了 Python 绑定：\n    * [MLComputePlan](https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fcoreml\u002Fmlcomputeplan-85vdw)\n    * [MLComputeDevice](https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fcoreml\u002Fmlcomputedeviceprotocol?language=objc)\n    * [MLModelStructure](https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fcoreml\u002Fmlmodelstructure-c.class?language=objc)\n    * [MLModelAsset](https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fcoreml\u002Fmlmodelasset?language=objc)\n* 各种其他错误修复、功能增强、代码清理和优化。\n    * 在缩放点积注意力中优先使用布尔掩码。\n    * 修复了使用布尔掩码时量化崩溃的问题。\n* 特别感谢本次发布的外部贡献者：@M-Quadra、@benjaminkech、@guru-desh。\n","2024-11-20T04:56:30",{"id":201,"version":202,"summary_zh":203,"released_at":204},117283,"8.0","# 发布说明\n\n与 7.2 版本相比（包括 8.0b1 和 8.0b2 中的功能）\n\n* 最新依赖库支持\n    * 兼容最新的 `protobuf` Python 包，可降低序列化延迟。\n    * 支持 `torch 2.4.0`、`numpy 2.0`、`scikit-learn 1.5`。\n* 支持有状态的 Core ML 模型\n    * 更新了转换器，以生成使用 State 类型（iOS 18\u002FmacOS 15 引入的新类型）的 Core ML 模型。\n    * 添加了一个简单的有状态注意力示例模型，展示如何使用就地键值缓存。\n* 提高对 `torch.export` 生成模型的转换支持覆盖率\n    * 算子转换支持度已达到与我们成熟的 `torch.jit.trace` 转换器相当的 56%。\n    * 已支持具有代表性的深度学习模型（MobileBERT、DeepLab、ESR、MobileNet、ViT、Inception、ResNet、Wav2Letter、EMformer）。\n    * 已支持具有代表性的基础模型（Llama、Stable Diffusion）。\n    * 经过 `ct.optimize.torch` 量化的模型，现在可以通过 `torch.export` 导出后再进行转换。\n* 新的压缩功能\n    * coremltools.optimize\n        * 支持更细粒度的压缩方式：块状量化、分组通道量化调色板化。\n        * 4 位权重量化和 3 位调色板化。\n        * 支持联合压缩模式（用于调色板化的 8 位查找表，以及剪枝+量化\u002F调色板化）。\n        * 通过设置 `cluster_dim > 1` 实现向量调色板化，并通过设置 `enable_per_channel_scale=True` 实现按通道缩放的调色板化。\n        * 实验性激活量化（将 W16A16 的 Core ML 模型转换为 W8A8 模型）。\n        * 更新了 `coremltools.optimize.coreml` 和 `coremltools.optimize.torch` 的 API。\n    * 支持部分由 `torchao` 量化的模型（包括 torchao 生成的算子，如 `_weight_int4pack_mm` 等）。\n    * 增加了对 `quantized_decomposed` 命名空间中更多算子的支持，例如 `embedding_4bit` 等。\n* 支持新算子并修复旧算子的 bug\n    * 压缩相关算子：`constexpr_blockwise_shift_scale`、`constexpr_lut_to_dense`、`constexpr_sparse_to_dense` 等。\n    * 对 GRU 算子进行了更新。\n    * SDPA 算子 `scaled_dot_product_attention`。\n    * `clip` 算子。\n* 更新了模型加载 API\n    * 支持 `optimizationHints`。\n    * 支持加载特定的预测函数。\n* `coremltools.utils` 中的新工具\n    * `coremltools.utils.MultiFunctionDescriptor` 和 `coremltools.utils.save_multifunction`：用于创建包含多个共享权重函数的 mlprogram。\n    * `coremltools.models.utils.bisect_model` 可以将大型 Core ML 模型拆分为两个大小相近的小模型。\n    * `coremltools.models.utils.materialize_dynamic_shape_mlmodel` 可以将输入形状灵活的模型转换为输入形状固定的模型。\n* 各种其他 bug 修复、功能增强、代码清理和优化。\n* 特别感谢本次发布的外部贡献者：@sslcandoit @FL33TW00D @dpanshu @timsneath @kasper0406 @lamtrinh","2024-09-16T20:50:54",{"id":206,"version":207,"summary_zh":208,"released_at":209},117284,"8.0b2","## 发行说明\n* 支持最新依赖项\n    * 兼容最新的 `protobuf` Python 包：提升序列化延迟。\n    * 兼容 `numpy 2.0`。\n    * 支持 `scikit-learn 1.5`。\n* 新的 Core ML 模型工具\n    * `coremltools.models.utils.bisect_model` 可以将一个大型 Core ML 模型拆分为两个大小相近的小模型。\n    * `coremltools.models.utils.materialize_dynamic_shape_mlmodel` 可以将输入形状灵活的模型转换为输入形状固定的模型。\n* `coremltools.optimize.coreml` 中的新压缩功能\n    * 向量调色板化：通过在 `coremltools.optimize.coreml.OpPalettizerConfig` 中设置 `cluster_dim > 1`，可以进行向量调色板化，此时查找表中的每个条目都是长度为 `cluster_dim` 的向量。\n    * 每通道缩放的调色板化：通过在 `coremltools.optimize.coreml.OpPalettizerConfig` 中设置 `enable_per_channel_scale=True`，权重会在被调色板化之前，先沿输出通道使用每通道缩放进行归一化。\n    * 联合压缩：支持一种新模式，即先将权重量化为 int8，再将其调色板化为具有 int8 条目、n 位宽度的查找表。\n    * 支持转换由 `coremltools.optimize.torch` 生成的 8 位 LUT 的调色板化模型。\n* `coremltools.optimize.torch` 中的新压缩功能及错误修复\n    * 增加了对使用 `coremltools.optimize.torch` 中的训练时 API 进行联合压缩的 Torch 模型的转换支持。\n    * 为 `SKMPalettizer` 增加了向量调色板化支持。\n    * 修复了使用 `PostTrainingPalettizer` 和 `DKMPalettizer` 进行向量调色板化时，沿输出通道构建权重向量的 bug。\n    * 在 `ModuleDKMPalettizerConfig` 中弃用了 `cluter_dtype` 选项，转而推荐使用 `lut_dtype`。\n    * 增加了使用 `PostTrainingQuantizer` 和 `LinearQuantizer` 对 `ConvTranspose` 模块进行量化支持。\n    * 为 `GPTQ` 的激活启发式算法增加了静态分组功能。\n    * 修复了在 `GPTQ` 中对采用每块量化方式的 `Conv2D` 层计算量化尺度时存在的 bug。\n    * 现在可以使用 `QAT` API 进行仅激活量化的操作。\n* 实验性 `torch.export` 转换支持\n    * 支持转换带有可变缓冲区的状态模型。\n    * 支持转换输入形状动态的模型。\n    * 支持转换 4 位权重压缩模型。\n* 支持新的 PyTorch 操作：`clip`。\n* 各种其他错误修复、功能增强、代码清理和优化。\n* 特别感谢本次发布的外部贡献者：@dpanshu、@timsneath、@kasper0406、@lamtrinhdev、@valfrom。\n\n## 附录\n* 转换状态模型 `torch.export` 模型的示例代码\n```python\nimport torch\nimport coremltools as ct\n\nclass Model(torch.nn.Module):\n    def __init__(self):\n        super(Model, self).__init__()\n        self.register_buffer(\"state_1\", torch.tensor([0.0, 0.0, 0.0]))\n\n    def forward(self, x):\n        # 模型状态的就地更新…","2024-08-16T01:02:36",{"id":211,"version":212,"summary_zh":213,"released_at":214},117285,"8.0b1","有关所有新功能，请参阅更新后的文档：[docs-guides](https:\u002F\u002Fapple.github.io\u002Fcoremltools\u002Fdocs-guides\u002Fsource\u002Fnew-features.html#new-in-core-ml-tools-8)\n\n* 新增工具 `coremltools.utils.MultiFunctionDescriptor()` 和 `coremltools.utils.save_multifunction`，用于创建包含多个函数且可共享权重的 `mlprogram`。同时更新了模型加载 API，以支持加载特定函数进行预测。\n* 有状态 Core ML 模型：转换器现已支持生成具有“状态类型”（iOS 18\u002FmacOS 15 中引入的新类型）的 Core ML 模型。\n* `coremltools.optimize`\n    * 针对压缩的模型表示（`mlprogram`）进行了更新：\n        * 支持更细粒度的压缩方式：块状量化、分组通道量化调色板化。\n        * 增加了 4 位权重量化（在已支持的 8 位量化基础上）。\n        * 增加了 3 位调色板化（在已支持的 1、2、4、6、8 位调色板化基础上）。\n        * 支持联合压缩模式：\n            * 调色板化的 8 位查找表。\n            * 权重剪枝与调色板化的结合能力。\n            * 权重剪枝与量化的结合能力。\n    * API 更新：\n        * `coremltools.optimize.coreml`\n            * 更新了现有 API 以支持上述新特性。\n            * 支持对已压缩模型进一步应用压缩技术进行联合压缩。\n            * 新增了一个使用校准数据进行激活量化的 API，可用于将 W16A16 的 Core ML 模型转换为 W8A8 模型：`ct.optimize.coreml.experimental.linear_quantize_activations`。\n                * （该 API 将在未来的版本中从实验性升级到正式命名空间）\n        * `coremltools.optimize.torch`\n            * 更新了现有 API 以支持上述新特性。\n            * 新增了无数据压缩的相关 API：`PostTrainingPalettizer` 和 `PostTrainingQuantizer`。\n            * 新增了基于校准数据的压缩 API：`SKMPalettizer`（用于敏感的 K-means 调色板化算法）、`layerwise_compression`（用于 GPTQ\u002F稀疏 GPT 量化\u002F剪枝算法）。\n            * 更新了相关 API 以及 `coremltools.convert` 的实现，使得使用 `ct.optimize.torch` 压缩后的 PyTorch 模型在转换时不再需要额外提供传递管道参数。\n* iOS 18 \u002F macOS 15 操作\n    * 与压缩相关的操作：`constexpr_blockwise_shift_scale`、`constexpr_lut_to_dense`、`constexpr_sparse_to_dense` 等。\n    * GRU 操作的更新。\n    * PyTorch 操作 `scaled_dot_product_attention`。\n* 实验性 `torch.export` 转换支持。\n\n```python\nimport torch\nimport torchvision\n\nimport coremltools as ct\n\ntorch_model = torchvision.models.vit_b_16(weights=\"IMAGENET1K_V1\")\n\nx = torch.rand((1, 3, 224, 224))\nexample_inputs = (x,)\nexported_program = torch.export.export(torch_model, ","2024-06-10T19:09:51",{"id":216,"version":217,"summary_zh":218,"released_at":219},117286,"7.2","* 新特性\n    * 支持 ExecuTorch 0.2（示例请参阅 [ExecuTorch 文档](https:\u002F\u002Fpytorch.org\u002Fexecutorch\u002Fstable\u002Fbuild-run-coreml.html)）\n        * Core ML 分区器：如果 PyTorch 模型仅部分支持 Core ML，则 Core ML 分区器可确定支持的部分，并让 ExecuTorch 将其委托给 Core ML 处理。\n        * Core ML 量化器：按照 Core ML 推荐的方案对 PyTorch 模型进行量化。\n* 功能增强\n    * 提升模型转换速度\n    * 扩展算子翻译覆盖范围\n        * 增加 `torch.narrow`\n        * 增加 `torch.adaptive_avg_pool1d` 和 `torch.adaptive_max_pool1d`\n        * 增加 `torch.numpy_t`（即 NumPy 风格的转置运算符 `.T`）\n        * 针对整数数据类型增强 `torch.clamp_min`\n        * 针对复杂数据类型增强 `torch.add`\n        * 当 `k` 为变量时，增强 `tf.math.top_k`\n\n感谢我们的 ExecuTorch 合作伙伴以及开源社区：@KrassCodes @M-Quadra @teelrabbit @minimalic @alealv @ChinChangYang @pcuenca","2024-04-22T23:27:42",{"id":221,"version":222,"summary_zh":223,"released_at":224},117287,"7.1","* **新特性**：\n    * 支持 Torch 2.1\n        * 包含对 `torch.export` API 的实验性支持，但仅限于 EDGE 语言子集。\n        * 示例用法：\n\n            *  ```python\n                import torch\n                from torch.export import export\n                from executorch.exir import to_edge\n\n                import coremltools as ct\n\n                example_args = (torch.randn(*size),)\n                aten_dialect = export(AnyNNModule(), example_args)\n                edge_dialect = to_edge(aten_dialect).exported_program()\n                edge_dialect._dialect = \"EDGE\"\n\n                mlmodel = ct.convert(edge_dialect)\n                ```\n\n\n* **增强功能**：\n    * API — `ct.utils.make_pipeline` — 现在允许指定计算单元。\n    * 新的优化传递：\n        * 将选择性数据移动操作（如 reshape、transpose）融合到相邻的常量压缩权重中。\n        * 当计算精度设置为 fp16 时，将所有中间张量的数据类型从 int32 转换为 int16。\n    * PyTorch 操作 — multinomial — 增加了对其在 CoreML 中的降级实现。\n    * 对 Pad 和 Gather\u002F类似 Gather 的操作进行了类型相关的改进。\n* **错误修复**：\n    * 修复了与 kmeans1d 包相关的 coremltools 构建问题。\n    * 对 PyTorch 操作 masked_fill 和 randint 的降级实现进行了小幅修复。\n* 各种其他错误修复、增强、代码清理和优化。","2023-11-01T14:46:14",{"id":226,"version":227,"summary_zh":228,"released_at":229},117288,"7.0","* New submodule [`coremltools.optimize`](https:\u002F\u002Fcoremltools.readme.io\u002Fv7.0\u002Fdocs\u002Foptimizing-models) for model quantization and compression\r\n    * `coremltools.optimize.coreml` for compressing coreml models, in a data free manner. `coremltools.compresstion_utils.*` APIs have been moved here\r\n    * `coremltools.optimize.torch` for compressing torch model with training data and fine-tuning. The fine tuned torch model can then be converted using `coremltools.convert`\r\n* The default neural network backend is now `mlprogram` for iOS15\u002FmacOS12. Previously calling `coremltools.convert()` without providing the `convert_to` or the `minimum_deployment_target` arguments, used the lowest deployment target (iOS11\u002FmacOS10.13) and the `neuralnetwork` backend. Now the conversion process will default to iOS15\u002FmacOS12 and the `mlprogram` backend. You can change this behavior by providing a `minimum_deployment_target` or `convert_to` value.\r\n* Python 3.11 support.\r\n* Support for new PyTorch ops: `repeat_interleave`, `unflatten`, `col2im`, `view_as_real`, `rand`, `logical_not`, `fliplr`, `quantized_matmul`, `randn`, `randn_like`, `scaled_dot_product_attention`, `stft`, `tile`\r\n* `pass_pipeline` parameter has been added to `coremltools.convert` to allow controls over which optimizations are performed.\r\n* MLModel batch prediction support.\r\n* Support for converting statically quantized PyTorch models.\r\n* Prediction from compiled model (`.modelc` files). Get compiled model files from an `MLModel` instance. Python API to explicitly compile a model.\r\n* Faster weight palletization for large tensors.\r\n* New utility method for getting weight metadata: `coremltools.optimize.coreml.get_weights_metadata`. This information can be used to customize optimization across ops when using `coremltools.optimize.coreml` APIs.\r\n* New and updated MIL ops for iOS17\u002FmacOS14\u002FwatchOS10\u002FtvOS17\r\n* `coremltools.compression_utils` is deprecated.\r\n* Changes default I\u002FO type for Neural Networks to FP16 for iOS16\u002FmacOS13 or later when `mlprogram` backend is used.\r\n* Changes upper input range behavior when backend is `mlprogram`:\r\n    * If `RangeDim` is used and no upper-bound is set (with a positive number), an exception will be raised.\r\n    * If the user does not use the `inputs` parameter but there are undetermined dim in input shape (for example, TF with \"None\" in input placeholder), it will be sanitized to a finite number (default_size + 1) and raise a warning.\r\n* Various other bug fixes, enhancements, clean ups and optimizations.\r\n\r\nSpecial thanks to our external contributors for this release: @fukatani , @pcuenca , @KWiecko , @comeweber , @sercand ,  @mlaves, @cclauss, @smpanaro , @nikalra, @jszaday \r\n","2023-09-18T21:47:03",{"id":231,"version":232,"summary_zh":233,"released_at":234},117289,"7.0b2","* The default neural network backend is now `mlprogram` for iOS15\u002FmacOS12. Previously calling `coremltools.convert()` without providing the `convert_to` or the `minimum_deployment_target` arguments, used the lowest deployment target (iOS11\u002FmacOS10.13) and the `neuralnetwork` backend. Now the conversion process will default to iOS15\u002FmacOS12 and the `mlprogram` backend. You can change this behavior by providing a `minimum_deployment_target` or `convert_to` value.\r\n* Changes default I\u002FO type for Neural Networks to FP16 for iOS16\u002FmacOS13 or later when `mlprogram` backend is used.\r\n* Changes upper input range behavior when backend is `mlprogram`:\r\n    * If `RangeDim` is used and no upper-bound is set (with a positive number), an exception will be raised.\r\n    * If the user does not use the `inputs` parameter but there are undetermined dim in input shape (for example, TF with \"None\" in input placeholder), it will be sanitized to a finite number (default_size + 1) and raise a warning.\r\n* New utility method for getting weight metadata: `coremltools.optimize.coreml.get_weights_metadata`. This information can be used to customize optimization across ops when using `coremltools.optimize.coreml` APIs.\r\n* Support for new PyTorch ops: `repeat_interleave` and `unflatten`.\r\n* New and updated iOS17\u002FmacOS14 ops: `batch_norm`, `conv`, `con`v`_transpose`, `expand_dims`, `gru`, `instance_norm`, `inverse`, `l2_norm`, `layer_norm`, `linear`, `local_response_norm`, `log`, `lstm`,  `matmul`, `reshape_like`, `resample`, `resize`, `reverse`, `reverse_sequence`, `rnn`, `rsqrt`, `slice_by_index`, `slice_by_size`, `sliding_windows`, `squeeze`, `transpose`.\r\n* Various other bug fixes, enhancements, clean ups and optimizations.\r\n\r\n\r\nSpecial thanks to our external contributors for this release: @fukatani, @pcuenca, @KWiecko, @comeweber and @sercand\r\n","2023-08-15T16:46:42",{"id":236,"version":237,"summary_zh":238,"released_at":239},117290,"7.0b1","* New submodule [`coremltools.optimize`](https:\u002F\u002Fcoremltools.readme.io\u002Fv7.0\u002Fdocs\u002Foptimizing-models) for model quantization and compression \r\n    * `coremltools.optimize.coreml` for compressing coreml models, in a data free manner. `coremltools.compresstion_utils.*` APIs have been moved here\r\n    * `coremltools.optimize.torch` for compressing torch model with training data and fine-tuning. The fine tuned torch model can then be converted using `coremltools.convert` \r\n* Updated MIL ops for iOS17\u002FmacOS14\u002FwatchOS10\u002FtvOS17\r\n* `pass_pipeline` parameter has been added to `coremltools.convert` to allow controls over which optimizations are performed. \r\n* Python 3.11 support.\r\n* MLModel batch prediction support.\r\n* Support for converting statically quantized PyTorch models\r\n* New Torch layer support: `randn`, `randn_like`, `scaled_dot_product_attention`, `stft`, `tile`\r\n* Faster weight palletization for large tensors. \r\n* `coremltools.models.ml_program.compression_utils` is deprecated.\r\n* Various other bug fixes, enhancements, clean ups and optimizations.\r\n\r\nCore ML tools 7.0 guide: https:\u002F\u002Fcoremltools.readme.io\u002Fv7.0\u002F\r\n\r\nSpecial thanks to our external contributors for this release: @fukatani, @pcuenca, @mlaves, @cclauss, @smpanaro, @nikalra, @jszaday","2023-06-05T22:41:37",{"id":241,"version":242,"summary_zh":243,"released_at":244},117291,"6.3","# Core ML Tools 6.3 Release Note\r\n\r\n* Torch 2.0 Support\r\n* TensorFlow 2.12.0 Support\r\n* Remove Python 3.6 support\r\n* Functionality for controling graph passes\u002Foptimizations, see the  `pass_pipeline` parameter to `coremltools.convert`.\r\n* A utility function for easily creating pipeline, see: `utils.make_pipeline`.\r\n* A debug utility function for extracting submodels, see: `converters.mil.debugging_utils.extract_submodel`\r\n* Various other bug fixes, enhancements, clean ups and optimizations.\r\n\r\n\r\nSpecial thanks to our external contributors for this release: @fukatani, @nikalra and @kevin-keraudren.\r\n","2023-04-03T16:26:24",{"id":246,"version":247,"summary_zh":248,"released_at":249},117292,"6.2","# Core ML Tools 6.2 Release Note\r\n\r\n* Support new PyTorch version: `torch==1.13.1` and `torchvision==0.14.1`.\r\n* New ops support:\r\n    * New PyTorch ops support: 1-D and N-D FFT \u002F RFFT \u002F IFFT \u002F IRFFT in `torch.fft`, `torchvision.ops.nms`, `torch.atan2`, `torch.bitwise_and`, `torch.numel`, \r\n    * New TensorFlow ops support: FFT \u002F RFFT \u002F IFFT \u002F IRFFT in `tf.signal`, `tf.tensor_scatter_nd_add`.\r\n* Existing ops improvements:\r\n    * Supports int input for `clamp` op.\r\n    * Supports dynamic `topk` (k not determined during compile time).\r\n    * Supports `padding='valid'` in PyTorch convolution.\r\n    * Supports PyTorch Adaptive Pooling.\r\n* Supports numpy v1.24.0 (#1718)\r\n* Add int8 affine quantization for the compression_utils.\r\n* Various other bug fixes, optimizations and improvements.\r\n\r\nSpecial thanks to our external contributors for this release: @fukatani, @ChinChangYang, @danvargg, @bhushan23 and @cjblocker.\r\n","2023-02-03T21:01:06",{"id":251,"version":252,"summary_zh":253,"released_at":254},117293,"6.1","* Support for TensorFlow `2.10`.\r\n* New PyTorch ops supported: `baddbmm`, `glu`, `hstack`, `remainder`, `weight_norm`, `hann_window`, `randint`, `cross`, `trace`, and `reshape_as.`\r\n* Avoid root logger and use the coremltools logger instead.\r\n* Support dynamic input shapes for PyTorch `repeat` and `expand` op.\r\n*  Enhance translation of torch `where` op with only one input.\r\n* Add support for PyTorch einsum equation: `'bhcq,bhck→bhqk’`.\r\n* Optimization graph pass improvement\r\n    * 3D convolution batchnorm fusion\r\n    * Consecutive relu fusion\r\n    * Noop elimination\r\n* Actively catch the tensor which has rank >= 6 and error out\r\n* Various other bug fixes, optimizations and improvements.\r\n\r\nSpecial thanks to our external contributors for this release: @fukatani, @piraka9011, @giorgiop, @hollance, @SangamSwadiK, @RobertRiachi, @waylybaye, @GaganNarula, and @sunnypurewal.\r\n","2022-11-14T23:01:12",{"id":256,"version":257,"summary_zh":258,"released_at":259},117294,"6.0","* MLProgram compression: affine quantization, palettize, sparsify. See `coremltools.compression_utils`\r\n* Python 3.10 support.\r\n* Support for latest scikit-learn version (`1.1.2`).\r\n* Support for latest PyTorch version (`1.12.1`).\r\n* Support for TensorFlow `2.8`.\r\n* Support for options to specify input and output data types, for both images and multiarrays\r\n    * Update coremltools python bindings to work with GRAYSCALE_FLOAT16 image datatype of CoreML\r\n    * New options to set input and output types to multi array of type float16, grayscale image of type float16 and set output type as images, similar to the `coremltools.ImageType` used with inputs.\r\n* New compute unit enum type: `CPU_AND_NE` to select the model runtime to the Neural engine and CPU. \r\n* Support for several new TensorFlow and PyTorch ops.\r\n* Changes to opset (available from iOS16, macOS13)\r\n    * New MIL ops: `full_like`, `resample`, `reshape_like`, `pixel_unshuffle`, `topk`\r\n    * Existing MIL ops with new functionality: `crop_resize`, `gather`, `gather_nd`, `topk`, `upsample_bilinear`.\r\n* API Breaking Changes: \r\n    * Do not assume source prediction column is “predictions”, fixes #58.\r\n    * Remove `useCPUOnly` parameter from `coremltools.convert` and `coremltools.models.MLModel`. Use `coremltools.ComputeUnit` instead.\r\n    * Remove ONNX support.\r\n    * Remove multi-backend Keras support. \r\n* Various other bug fixes, optimizations and improvements.\r\n","2022-09-19T18:13:45",{"id":261,"version":262,"summary_zh":263,"released_at":264},117295,"6.0b2","* Support for new MIL ops added in iOS16\u002FmacOS13: `pixel_unshuffle`, `resample`, `topk`\r\n* Update coremltools python bindings to work with GRAYSCALE_FLOAT16 image datatype of CoreML\r\n* New compute unit enum type: `CPU_AND_NE`\r\n* New PyTorch ops: `AdaptiveAvgPool2d`, `cosine_similarity`, `eq`, `linalg.norm`, `linalg.matrix_norm`, `linalg.vector_norm`, `ne`, `PixelUnshuffle`\r\n* Support for `identity_n` TensorFlow op\r\n* Various other bug fixes, optimizations and improvements.\r\n","2022-08-01T21:52:27",{"id":266,"version":267,"summary_zh":268,"released_at":269},117296,"6.0b1","* MLProgram compression: affine quantization, palettize, sparsify. See `coremltools.compression_utils`. \r\n* New options to set input and output types to multi array of type float16, grayscale image of type float16 and set output type as images, similar to the `coremltools.ImageType` used with inputs.  \r\n* Support for PyTorch 1.11.0.\r\n* Support for TensorFlow 2.8.\r\n* [API Breaking Change] Remove `useCPUOnly` parameter from `coremltools.convert` and `coremltools.models.MLModel`. Use `coremltools.ComputeUnit` instead.\r\n* Support for many new PyTorch and TensorFlow layers\r\n* Many bug fixes and enhancements.\r\n\r\n\r\n**Known issues**\r\n* While conversion and CoreML models with Grayscale Float16 images should work with ios16\u002Fmacos13 beta, the coremltools-CoreML python binding has an issue which would cause the `predict` API in coremltools to crash when the either the input or output is of type grayscale float16 \r\n* The new Compute unit configuration `MLComputeUnitsCPUAndNeuralEngine` is not available in coremltools yet \r\n","2022-06-07T17:37:18",{"id":271,"version":272,"summary_zh":273,"released_at":274},117297,"5.2","* Support latest version (1.10.2) of PyTorch\r\n* Support TensorFlow 2.6.2\r\n* Support New PyTorch ops:\r\n    * `bitwise_not`\r\n    * `dim`\r\n    * `dot`\r\n    * `eye`\r\n    * `fill`\r\n    * `hardswish`\r\n    * `linspace`\r\n    * `mv`\r\n    * `new_full`\r\n    * `new_zeros`\r\n    * `rrelu`\r\n    * `selu`\r\n* Support TensorFlow ops\r\n    * `DivNoNan`\r\n    * `Log1p`\r\n    * `SparseSoftmaxCrossEntropyWithLogits`\r\n* Various bug fixes, clean ups and optimizations.\r\n* This is the final coremltools version to support Python 3.5\r\n\r\n","2022-02-22T22:36:08"]