[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-sonos--tract":3,"tool-sonos--tract":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 真正成长为懂上",144730,2,"2026-04-07T23:26:32",[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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107888,"2026-04-06T11:32:50",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":119,"forks":120,"last_commit_at":121,"license":122,"difficulty_score":123,"env_os":124,"env_gpu":125,"env_ram":126,"env_deps":127,"category_tags":136,"github_topics":137,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":144,"updated_at":145,"faqs":146,"releases":181},5336,"sonos\u002Ftract","tract","Tiny, no-nonsense, self-contained, Tensorflow and ONNX inference","tract 是一款由 Sonos 开发的轻量级神经网络推理引擎，专为高效执行 TensorFlow 和 ONNX 模型而设计。它旨在解决在资源受限环境（如嵌入式设备或移动端）中部署复杂 AI 模型时的性能与兼容性问题，让开发者无需依赖庞大的框架即可快速运行训练好的模型。\n\n这款工具非常适合嵌入式系统开发者、AI 工程师以及需要在生产环境中优化推理性能的研究人员使用。tract 的核心优势在于其“极简主义”架构：完全自包含、无多余依赖，且基于 Rust 语言编写，确保了内存安全与卓越的运行效率。它能够读取 ONNX 或 NNEF 格式的模型，自动进行图优化，并直接执行推理任务。\n\n在兼容性方面，tract 已支持包括 ResNet、BERT、MobileNet 在内的主流模型，并覆盖了约 85% 的 ONNX 后端测试用例。虽然为了保持核心简洁与高性能，它暂未支持张量序列等边缘特性，但对绝大多数实际应用场景中的算子提供了完善支持。如果你正在寻找一个稳定、快速且易于集成的推理方案，tract 是一个值得考虑的专业选择。","![tract-logo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsonos_tract_readme_f8adc41b6f31.png)\n\n![Rust](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Frust-%23000000.svg?style=for-the-badge&logo=rust&logoColor=white)\n![rustc >= 1.91.0](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Frustc-%3E%3D1.91.0-brightgreen)\n![MIT\u002FApache 2](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fl\u002Ftract)\n[![Native Linux test status](https:\u002F\u002Fgithub.com\u002Fsnipsco\u002Ftract\u002Fworkflows\u002FNative%20Linux\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsnipsco\u002Ftract\u002Factions)\n[![Embedded targets status](https:\u002F\u002Fgithub.com\u002Fsnipsco\u002Ftract\u002Fworkflows\u002FEmbedded%20targets\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsnipsco\u002Ftract\u002Factions)\n[![Doc](https:\u002F\u002Fdocs.rs\u002Ftract-core\u002Fbadge.svg)](https:\u002F\u002Fdocs.rs\u002Ftract-core)\n\n[![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)](https:\u002F\u002Fpypi.org\u002Fproject\u002Ftract\u002F)\n\n\nSonos' Neural Network inference engine.\n\n_This project used to be called tfdeploy, or Tensorflow-deploy-rust._\n\n## What ?\n\n`tract` is a Neural Network inference toolkit. It can read ONNX or NNEF, optimize them and run them.\n\n## Quick start, examples\n\n* [MobileNet v2 with ONNX](examples\u002Fonnx-mobilenet-v2)\n* [BERT example with ONNX](examples\u002Fpytorch-albert-v2)\n* [MobileNet v2 with TensorFlow](examples\u002Ftensorflow-mobilenet-v2)\n* [From Keras and TensorFlow 2 to tract](examples\u002Fkeras-tract-tf2)\n* [ResNet with PyTorch](examples\u002Fpytorch-resnet)\n\nThere is also [some technical documentation](doc\u002F) and [blog](https:\u002F\u002Ftech-blog.sonos.com\u002Fposts\u002Foptimising-a-neural-network-for-inference\u002F) posts.\n\n## Tract in the landscape\n\n### ONNX\n\nAs of today, `tract` passes successfully about 85% of ONNX backends\ntests. All \"real life\" integration tests in ONNX test suite are passing: \nbvlc_alexnet, densenet121, inception_v1, inception_v2, resnet50, shufflenet,\nsqueezenet, vgg19, zfnet512.\n\nNotable missing parts are operators dealing with Tensor Sequences and Optional Tensors : tract \u002Freally\u002F wants to flow Tensors and nothing else.\nThis is structural. Changing it would be pretty difficult, and it's unclear whether it can be done without impairing performance or maintainability.\nWe are not convinced these features have shown their interest in the wild yet, so we prefer to leave them aside.\n\nOther dark corners are specific operators like \"Resize\" which fit perfectly in the framework but need a complex internal logic that is far\nfrom our core business. In these cases, we are happy to accept contributions and to help. \n\nThe following operators are implemented and tested.\n\nAbs, Acos, Acosh, Add, And, ArgMax, ArgMin, ArrayFeatureExtractor, Asin, Asinh, Atan, Atanh, AveragePool, BatchNormalization, BitShift, BitwiseAnd, BitwiseNot, BitwiseOr, BitwiseXor, BlackmanWindow, Cast, CastLike, CategoryMapper, Ceil, Clip, Compress, Concat, Constant, ConstantLike, ConstantOfShape, Conv, ConvInteger, ConvTranspose, Cos, Cosh, CumSum, DFT, DepthToSpace, DequantizeLinear, Div, Dropout, DynamicQuantizeLinear, Einsum, Elu, Equal, Erf, Exp, Expand, EyeLike, Flatten, Floor, GRU, Gather, GatherElements, GatherND, Gemm, GlobalAveragePool, GlobalLpPool, GlobalMaxPool, Greater, GreaterOrEqual, HammingWindow, HannWindow, HardSigmoid, Hardmax, Identity, If, InstanceNormalization, IsInf, IsNaN, LRN, LSTM, LeakyRelu, Less, LessOrEqual, Log, LogSoftmax, MatMul, MatMulInteger, Max, MaxPool, Mean, MelWeightMatrix, Min, Mod, Mul, Multinomial, Neg, NonMaxSuppression, NonZero, Not, OneHot, Or, PRelu, Pad, ParametricSoftplus, Pow, QLinearConv, QLinearMatMul, QuantizeLinear, RNN, RandomNormal, RandomNormalLike, RandomUniform, RandomUniformLike, Range, Reciprocal, ReduceL1, ReduceL2, ReduceLogSum, ReduceLogSumExp, ReduceMax, ReduceMean, ReduceMin, ReduceProd, ReduceSum, ReduceSumSquare, Relu, Reshape, Resize, Round, Rsqrt, STFT, ScaledTanh, Scan, Scatter, ScatterElements, ScatterND, Selu, Shape, Shrink, Sigmoid, Sign, Sin, Sinh, Size, Slice, Softmax, Softplus, Softsign, SpaceToDepth, Split, Sqrt, Squeeze, Sub, Sum, Tan, Tanh, ThresholdedRelu, Tile, Transpose, TreeEnsembleClassifier, Unsqueeze, Where, Xor\n\nWe test these operators against from ONNX 1.4.1 (operator set 9), up to ONNX 1.13.0 (operator set 18).\n\nWe are using ONNX test suite, but it does not cover everything.\nWe also deliberately ignore some tests, or restricting their scope depending on what we feel is realistic.\nSometimes these decisions are just wrong, and sometimes they become wrong as time goes by and the fields moves in unexpected directions.\nSo if you are puzzled by an ONNX model that does not work in tract, we are happy to take a look.\n\n### NNEF\n\nLong story short, TensorFlow and ONNX formats are good for designing and\ntraining networks. They need to move fast to follow the research field, tend to\nintegrate new features and operators greedily. They also exhibit a high level\nof expressivity to facilitate network design.\n\nOn the other hand, only a subset of operators and network features actually\nreach production, so systems running production network do not have to deal\nwith so many operators. Furthermore, some information required for training can\nbe stripped from the network before going to production for prediction.\n\nNNEF tries to bridge the gap between training frameworks and inference by\nproposing a format dedicated to production and prediction.\n\nTract supports NNEF:\n\n* tract_nnef can load and execute NNEF networks\n* tract supports most of the NNEF specification, the most notable exception\n    being the ROI operators\n* tract introduces tract-OPL, a series of NNEF extensions to support other\n    operators (or extend some operators semantics) in order to represent the\n    full range of tract-core neural network support: any network understood by\n    tract should be serializable to tract-OPL. This is a work in progress.\n* tract command line can translate networks from TensorFlow or ONNX to NNEF\u002FOPL.\n\n### tract-opl version compatibility\n\nA remainder: NNEF is not expressive enough to represent all ONNX. tract-OPL extends\nNNEF using proprietary to support what is missing. Notable extensions are pulse\noperators, recurring operators (as Scan) and symbolic extensions.\n\nThere is no strict check in place here, so... implementation is not bullet proof.\n* NNEF part aims at being very stable. It is strongly constrained with compatibility\nwith NNEF specification.\n* tract-opl is a bit more in flux. Nevertheless we try to maintain the following\ngolden rule:\n\n     `models serialized with tract 0.x.y should work with tract 0.x.z where z >= y`\n\n* in practice, breaking changes have been relatively rare so far. Most models are\nforward and retro compatible from when tract has acquired NNEF support.\n\nNotable breakage occurred:\n* 0.16.3 (forward compatible) on Scan operator\n* 0.17.0 for binary decision tree classifier\n\nStarting with `0.17.0`, a model property is injected in tract-opl files (`tract_nnef_ser_version`)\nto tag which version of tract generated the file. As most models will remain compatible,\ntract will not do any version check. It is up to the application developer to do so.\n\nA softer version tag exists as `tract_nnef_format_version`. pre-0.17.0 version set it to\n`alpha1`, post-0.17.0 set it `beta1`. Don't put too much emphasis into the \"alpha-ness\" naming \nof versions here.\n\n### Note: support for TensorFlow 1.x\n\nEven if `tract` is very far from supporting any arbitrary model, it can run\nGoogle Inception v3 and Snips wake word models. Missing operators are relatively \neasy to add. The lack of easy to reuse test suite, and the wide diversity of \noperators in Tensorflow make it difficult to target a full support.\n\nThe following operators are implemented and tested:\n\nAbs, Add, AddN, AddV2, Assign, AvgPool, BatchToSpaceND, BiasAdd, BlockLSTM, Cast, Ceil, ConcatV2, Const, Conv2D, DepthwiseConv2dNative, Div, Enter, Equal, Exit, ExpandDims, FakeQuantWithMinMaxVars, Fill, FloorMod, FusedBatchNorm, GatherNd, GatherV2, Greater, GreaterEqual, Identity, Less, LessEqual, Log, LogicalAnd, LogicalOr, LoopCond, MatMul, Max, MaxPool, Maximum, Mean, Merge, Min, Minimum, Mul, Neg, NoOp, Pack, Pad, Placeholder, Pow, Prod, RandomUniform, RandomUniformInt, Range, RealDiv, Relu, Relu6, Reshape, Rsqrt, Shape, Sigmoid, Slice, Softmax, SpaceToBatchND, Squeeze, StridedSlice, Sub, Sum, Switch, Tanh, Tile, Transpose, VariableV2\n\nAdditionally, the complexity of TensorFlow 2 make it very unlikely that a direct\nsupport will ever exist in tract. But many TensorFlow 2 models can be\nconverted to ONNX and then loaded in tract.\n\n## Example of supported networks\n\nThese models among others, are used to track tract performance evolution as\npart of the Continuous Integration jobs. See [.travis\u002FREADME.md](readme) and \n[.travis\u002Fbundle-entrypoint.sh](.travis\u002Fbundle-entrypoint.sh) for more\ninformation.\n\n### Keyword spotting on Arm Cortex-M Microcontrollers\n\nhttps:\u002F\u002Fgithub.com\u002FARM-software\u002FML-KWS-for-MCU\n\nARM demonstrated the capabilities of the Cortex-M family by providing\ntutorials and pre-trained models for keyword spotting. While the exercise\nis ultimately meant for micro-controllers, `tract` can run the intermediate\nTensorFlow models.\n\nFor instance, on a Raspberry Pi Zero, the \"CNN M\" model runs in about 70\nmicro-seconds, and 11 micro-seconds on a Raspberry Pi 3.\n\n### Snips wake word models\n\nhttps:\u002F\u002Farxiv.org\u002Fabs\u002F1811.07684\n\nSnips uses `tract` to run the wake word detectors. While earlier models were\nclass-based and did not require any special treatment, `tract` pulsing\ncapabilities made it possible to run WaveNet models efficiently enough for a\nRaspberry Pi Zero.\n\n### Inception v3\n\n|      Device         |      Family    |  TensorFlow-lite  |  tract  |\n|---------------------|----------------|-------------------|---------|\n|  Raspberry Pi Zero  |    Armv6 VFP   |        113s       |   39s   |\n|  Raspberry Pi 2     |    Armv7 NEON  |         25s       |    7s   |\n|  Raspberry Pi 3     |  aarch32 NEON  |          5s       |    5s   |\n\nNotes:\n\n * while the Raspberry Pi 3 is an Armv8 device, this bench is running\n     on Raspbian, an armv6 operating system, crippling the performance\n     of both benches\n * there exists other benches on the internet that show better\n     performance results for TensorFlow (not -Lite) on the Pi 3.\n     They use all four cores of the device. Both TensorFlow-Lite and tract\n     here have been made to run on a single-core.\n\n# License\n\nNote: files in the `tensorflow\u002Fprotos` directory are copied from the\n[TensorFlow](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Ftensorflow) project and are not\ncovered by the following licence statement.\n\nNote: files in the `onnx\u002Fprotos` directory are copied from the\n[ONNX](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fonnx) project and are not\ncovered by the following license statement.\n\n## Apache 2.0\u002FMIT\n\nAll original work licensed under either of\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any Contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n","![tract-logo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsonos_tract_readme_f8adc41b6f31.png)\n\n![Rust](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Frust-%23000000.svg?style=for-the-badge&logo=rust&logoColor=white)\n![rustc >= 1.91.0](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Frustc-%3E%3D1.91.0-brightgreen)\n![MIT\u002FApache 2](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fl\u002Ftract)\n[![Native Linux test status](https:\u002F\u002Fgithub.com\u002Fsnipsco\u002Ftract\u002Fworkflows\u002FNative%20Linux\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsnipsco\u002Ftract\u002Factions)\n[![Embedded targets status](https:\u002F\u002Fgithub.com\u002Fsnipsco\u002Ftract\u002Fworkflows\u002FEmbedded%20targets\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsnipsco\u002Ftract\u002Factions)\n[![Doc](https:\u002F\u002Fdocs.rs\u002Ftract-core\u002Fbadge.svg)](https:\u002F\u002Fdocs.rs\u002Ftract-core)\n\n[![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)](https:\u002F\u002Fpypi.org\u002Fproject\u002Ftract\u002F)\n\n\nSonos的神经网络推理引擎。\n\n_该项目曾被称为tfdeploy，即Tensorflow-deploy-rust。_\n\n## 是什么？\n\n`tract`是一个神经网络推理工具包。它可以读取ONNX或NNEF格式的模型，对其进行优化并运行。\n\n## 快速入门与示例\n\n* [使用ONNX格式的MobileNet v2](examples\u002Fonnx-mobilenet-v2)\n* [使用ONNX格式的BERT示例](examples\u002Fpytorch-albert-v2)\n* [使用TensorFlow格式的MobileNet v2](examples\u002Ftensorflow-mobilenet-v2)\n* [从Keras和TensorFlow 2转换为tract](examples\u002Fkeras-tract-tf2)\n* [使用PyTorch的ResNet](examples\u002Fpytorch-resnet)\n\n此外，还有[一些技术文档](doc\u002F)和[博客文章](https:\u002F\u002Ftech-blog.sonos.com\u002Fposts\u002Foptimising-a-neural-network-for-inference\u002F)可供参考。\n\n## tract在行业中的位置\n\n### ONNX\n\n截至今日，`tract`成功通过了约85%的ONNX后端测试。ONNX测试套件中所有“实际应用”的集成测试均已通过：包括bvlc_alexnet、densenet121、inception_v1、inception_v2、resnet50、shufflenet、squeezenet、vgg19以及zfnet512等模型。\n\n目前仍缺失的部分主要是处理张量序列和可选张量的算子。`tract`的核心设计理念是只处理张量流，而不涉及其他复杂结构。这一设计具有一定的结构性限制，若要修改将较为困难，且可能会影响性能和可维护性。我们尚未看到这些功能在实际应用中展现出显著价值，因此暂时选择不支持。\n\n此外，还有一些特定的算子（如Resize）虽然完全符合框架的设计理念，但其内部逻辑较为复杂，与我们的核心业务目标存在一定距离。对于这类情况，我们非常欢迎社区贡献，并愿意提供帮助。\n\n以下是一些已实现并经过测试的算子：\n\nAbs, Acos, Acosh, Add, And, ArgMax, ArgMin, ArrayFeatureExtractor, Asin, Asinh, Atan, Atanh, AveragePool, BatchNormalization, BitShift, BitwiseAnd, BitwiseNot, BitwiseOr, BitwiseXor, BlackmanWindow, Cast, CastLike, CategoryMapper, Ceil, Clip, Compress, Concat, Constant, ConstantLike, ConstantOfShape, Conv, ConvInteger, ConvTranspose, Cos, Cosh, CumSum, DFT, DepthToSpace, DequantizeLinear, Div, Dropout, DynamicQuantizeLinear, Einsum, Elu, Equal, Erf, Exp, Expand, EyeLike, Flatten, Floor, GRU, Gather, GatherElements, GatherND, Gemm, GlobalAveragePool, GlobalLpPool, GlobalMaxPool, Greater, GreaterOrEqual, HammingWindow, HannWindow, HardSigmoid, Hardmax, Identity, If, InstanceNormalization, IsInf, IsNaN, LRN, LSTM, LeakyRelu, Less, LessOrEqual, Log, LogSoftmax, MatMul, MatMulInteger, Max, MaxPool, Mean, MelWeightMatrix, Min, Mod, Mul, Multinomial, Neg, NonMaxSuppression, NonZero, Not, OneHot, Or, PRelu, Pad, ParametricSoftplus, Pow, QLinearConv, QLinearMatMul, QuantizeLinear, RNN, RandomNormal, RandomNormalLike, RandomUniform, RandomUniformLike, Range, Reciprocal, ReduceL1, ReduceL2, ReduceLogSum, ReduceLogSumExp, ReduceMax, ReduceMean, ReduceMin, ReduceProd, ReduceSum, ReduceSumSquare, Relu, Reshape, Resize, Round, Rsqrt, STFT, ScaledTanh, Scan, Scatter, ScatterElements, ScatterND, Selu, Shape, Shrink, Sigmoid, Sign, Sin, Sinh, Size, Slice, Softmax, Softplus, Softsign, SpaceToDepth, Split, Sqrt, Squeeze, Sub, Sum, Tan, Tanh, ThresholdedRelu, Tile, Transpose, TreeEnsembleClassifier, Unsqueeze, Where, Xor\n\n我们对这些算子进行了全面测试，覆盖了从ONNX 1.4.1（算子集9）到ONNX 1.13.0（算子集18）的所有版本。\n\n尽管我们使用了ONNX测试套件，但它并不能涵盖所有场景。同时，我们也根据实际情况有意识地忽略了一些测试用例，或对其范围进行了限制。然而，随着时间推移和领域的发展，某些决策可能会变得不再适用。因此，如果您遇到无法在`tract`中运行的ONNX模型，欢迎随时联系我们进行排查。\n\n### NNEF\n\n简而言之，TensorFlow和ONNX格式非常适合用于网络的设计和训练。它们需要快速迭代以跟上研究领域的进展，往往会积极引入新特性和算子，并具备较高的表达能力，便于网络设计。\n\n然而，在实际生产环境中，真正被部署的算子和网络特性往往只是其中的一小部分。因此，用于预测的生产系统并不需要支持如此多的算子。此外，一些仅在训练阶段有用的信息也可以在部署前从网络中移除。\n\nNNEF旨在弥合训练框架与推理之间的差距，提出了一种专为生产和预测设计的格式。\n\n`tract`支持NNEF：\n\n* `tract_nnef`模块可以加载并执行NNEF格式的模型。\n* `tract`支持NNEF规范中的大多数内容，最显著的例外是ROI相关的算子。\n* `tract`还引入了`tract-OPL`扩展，用于支持更多算子或扩展现有算子的功能语义，从而能够表示`tract-core`所支持的完整算子集合：任何由`tract`理解的网络都应能被序列化为`tract-OPL`格式。目前这一工作仍在推进中。\n* `tract`命令行工具还可以将TensorFlow或ONNX格式的模型转换为NNEF\u002FOPL格式。\n\n### tract-opl 版本兼容性\n\n提醒一下：NNEF 的表达能力不足以表示所有的 ONNX 模型。tract-OPL 通过专有扩展来弥补 NNEF 的不足，支持那些缺失的功能。显著的扩展包括脉冲算子、循环算子（如 Scan）以及符号化扩展。\n\n目前并没有严格的版本检查机制，因此实现并不完全健壮。  \n* NNEF 部分旨在保持高度稳定，并严格遵循 NNEF 规范以确保兼容性。\n* tract-opl 则相对更加灵活多变。尽管如此，我们仍坚持以下黄金法则：\n\n     `使用 tract 0.x.y 序列化的模型应在 tract 0.x.z 中正常运行，其中 z ≥ y`\n\n* 实际上，迄今为止破坏性变更相对较少。自 tract 支持 NNEF 以来，大多数模型都具备向前和向后的兼容性。\n\n值得注意的不兼容情况包括：\n* 0.16.3 版本（向前兼容）对 Scan 算子的处理变化\n* 0.17.0 版本对二元决策树分类器的支持调整\n\n从 `0.17.0` 版本开始，tract-opl 文件中会注入一个模型属性 (`tract_nnef_ser_version`)，用于标记生成该文件的 tract 版本。由于大多数模型仍将保持兼容性，tract 不会进行版本检查，而是由应用程序开发者自行负责。\n\n此外，还有一个较为宽松的版本标签 `tract_nnef_format_version`。0.17.0 之前的版本将其设置为 `alpha1`，而之后的版本则设置为 `beta1`。请不要过于在意这里的“alpha”命名。\n\n### 注意：对 TensorFlow 1.x 的支持\n\n尽管 `tract` 距离支持任意模型还有很大差距，但它已经能够运行 Google Inception v3 和 Snips 唤醒词模型。缺失的算子相对容易添加。然而，缺乏易于复用的测试套件，以及 TensorFlow 中算子种类繁多，使得全面支持变得困难。\n\n目前已实现并经过测试的算子包括：\n\nAbs, Add, AddN, AddV2, Assign, AvgPool, BatchToSpaceND, BiasAdd, BlockLSTM, Cast, Ceil, ConcatV2, Const, Conv2D, DepthwiseConv2dNative, Div, Enter, Equal, Exit, ExpandDims, FakeQuantWithMinMaxVars, Fill, FloorMod, FusedBatchNorm, GatherNd, GatherV2, Greater, GreaterEqual, Identity, Less, LessEqual, Log, LogicalAnd, LogicalOr, LoopCond, MatMul, Max, MaxPool, Maximum, Mean, Merge, Min, Minimum, Mul, Neg, NoOp, Pack, Pad, Placeholder, Pow, Prod, RandomUniform, RandomUniformInt, Range, RealDiv, Relu, Relu6, Reshape, Rsqrt, Shape, Sigmoid, Slice, Softmax, SpaceToBatchND, Squeeze, StridedSlice, Sub, Sum, Switch, Tanh, Tile, Transpose, VariableV2\n\n另外，TensorFlow 2 的复杂性使得 tract 很难直接支持它。不过，许多 TensorFlow 2 模型可以转换为 ONNX 格式，然后再加载到 tract 中。\n\n## 支持的网络示例\n\n这些模型以及其他模型被用于跟踪 tract 性能的演变，作为持续集成任务的一部分。更多信息请参阅 [.travis\u002FREADME.md](readme) 和 [.travis\u002Fbundle-entrypoint.sh](.travis\u002Fbundle-entrypoint.sh)。\n\n### ARM Cortex-M 微控制器上的关键词检测\n\nhttps:\u002F\u002Fgithub.com\u002FARM-software\u002FML-KWS-for-MCU\n\nARM 通过提供教程和预训练的关键词检测模型，展示了 Cortex-M 系列处理器的能力。虽然这一实践主要面向微控制器，但 `tract` 仍然可以运行其中间步骤的 TensorFlow 模型。\n\n例如，在 Raspberry Pi Zero 上，“CNN M”模型的推理时间约为 70 微秒；而在 Raspberry Pi 3 上，则为 11 微秒。\n\n### Snips 唤醒词模型\n\nhttps:\u002F\u002Farxiv.org\u002Fabs\u002F1811.07684\n\nSnips 使用 `tract` 来运行唤醒词检测器。早期的模型基于分类任务，无需特殊处理；而得益于 tract 的脉冲计算能力，WaveNet 模型得以在 Raspberry Pi Zero 上高效运行。\n\n### Inception v3\n\n|      设备         |      架构    |  TensorFlow-lite  |  tract  |\n|---------------------|----------------|-------------------|---------|\n|  Raspberry Pi Zero  |    Armv6 VFP   |        113s       |   39s   |\n|  Raspberry Pi 2     |    Armv7 NEON  |         25s       |    7s   |\n|  Raspberry Pi 3     |  aarch32 NEON  |          5s       |    5s   |\n\n注释：\n\n * 尽管 Raspberry Pi 3 是一款 Armv8 设备，但本次基准测试是在 Raspbian 操作系统上进行的，该系统基于 armv6 架构，这严重限制了两个框架的性能。\n * 网络上存在其他关于 Pi 3 上 TensorFlow（非 Lite 版本）性能的基准测试结果，显示其表现更好。这些测试利用了设备的四核处理器。而此处的 TensorFlow-Lite 和 tract 均仅在单核环境下运行。\n\n# 许可证\n\n注意：`tensorflow\u002Fprotos` 目录下的文件是从 [TensorFlow](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Ftensorflow) 项目复制而来，并不受以下许可声明的约束。\n\n注意：`onnx\u002Fprotos` 目录下的文件是从 [ONNX](https:\u002F\u002Fgithub.com\u002Fonnx\u002Fonnx) 项目复制而来，也不受以下许可声明的约束。\n\n## Apache 2.0\u002FMIT\n\n所有原创作品均根据您的选择，采用以下任一许可证进行授权：\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) 或 http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0)\n * MIT 许可证 ([LICENSE-MIT](LICENSE-MIT) 或 http:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\n\n## 贡献\n\n除非您明确声明相反意见，否则您有意提交并纳入本作品的任何贡献，将按照 Apache-2.0 许可协议的规定，以双重许可方式授权，且不附加任何额外条款或条件。","# tract 快速上手指南\n\n`tract` 是 Sonos 开发的高性能神经网络推理引擎（基于 Rust），支持加载、优化并运行 ONNX 和 NNEF 格式的模型。它特别适用于嵌入式设备、边缘计算及对性能敏感的生产环境。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**：Linux (推荐), macOS, Windows\n- **架构支持**：x86_64, ARM (包括 Cortex-M 微控制器), AArch64\n- **Rust 版本**：`rustc >= 1.91.0`\n\n### 前置依赖\n确保已安装 Rust 工具链。若未安装，请使用以下命令（国内开发者推荐使用清华或中科大镜像加速）：\n\n```bash\n# 使用国内镜像安装 rustup\nexport RUSTUP_DIST_SERVER=https:\u002F\u002Fmirrors.tuna.tsinghua.edu.cn\u002Frustup\nexport RUSTUP_UPDATE_ROOT=https:\u002F\u002Fmirrors.tuna.tsinghua.edu.cn\u002Frustup\u002Frustup\ncurl --proto '=https' --tlsv1.2 -sSf https:\u002F\u002Fmirrors.tuna.tsinghua.edu.cn\u002Frustup\u002Frustup-init.sh | sh\n\n# 安装完成后，确保 rustc 版本 >= 1.91.0\nrustc --version\n```\n\n若需使用 Python 绑定，请确保已安装 Python 3.6+ 及 `pip`。\n\n## 安装步骤\n\n### 方式一：作为 Rust 库使用\n在你的 Rust 项目 `Cargo.toml` 中添加依赖：\n\n```toml\n[dependencies]\ntract-onnx = \"0.21\" # 请根据 crates.io 最新版本调整\n# 或者同时支持 TensorFlow\ntract-tensorflow = \"0.21\"\n```\n\n然后在代码中引入：\n```rust\nuse tract_onnx::prelude::*;\n```\n\n### 方式二：使用命令行工具 (CLI)\n安装 `tract` 命令行工具以便直接转换或运行模型：\n\n```bash\ncargo install tract\n```\n\n*注：国内网络若下载 crates 索引缓慢，可配置 `.cargo\u002Fconfig.toml` 使用稀疏协议或替换源。*\n\n### 方式三：Python 绑定\n通过 PyPI 安装（支持国内镜像加速）：\n\n```bash\npip install tract -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n## 基本使用\n\n### 场景 1：使用命令行运行 ONNX 模型\n假设你有一个名为 `mobilenet_v2.onnx` 的模型和一个输入图像预处理后的张量文件 `input.npy`。\n\n1. **查看模型信息**：\n   ```bash\n   tract mobilenet_v2.onnx info\n   ```\n\n2. **运行推理**（自动处理输入输出）：\n   ```bash\n   tract mobilenet_v2.onnx run input.npy\n   ```\n\n3. **将 ONNX 模型转换为 NNEF 格式**（用于生产部署）：\n   ```bash\n   tract mobilenet_v2.onnx dump --nnef my_model.nnef\n   ```\n\n### 场景 2：在 Rust 代码中加载并运行模型\n以下是最小化的 Rust 示例，展示如何加载 ONNX 模型并执行推理：\n\n```rust\nuse tract_onnx::prelude::*;\n\nfn main() -> TractResult\u003C()> {\n    \u002F\u002F 1. 加载并构建模型\n    let model = tract_onnx::onnx()\n        .model_for_path(\"mobilenet_v2.onnx\")?\n        .into_optimized()?\n        .into_runnable()?;\n\n    \u002F\u002F 2. 创建输入张量 (示例：1x3x224x224 的 f32 张量)\n    let input = tensor4(&[[[[0.0f32; 224]; 224]; 3]; 1]);\n    \n    \u002F\u002F 3. 运行推理\n    let output = model.run(tvec!(input))?;\n    \n    \u002F\u002F 4. 获取结果\n    println!(\"推理完成，输出形状：{:?}\", output[0].shape());\n    \n    Ok(())\n}\n```\n\n### 场景 3：在 Python 中使用\n```python\nimport tract\n\n# 加载 ONNX 模型\nmodel = tract.onnx().model_for_path(\"mobilenet_v2.onnx\")\n\n# 优化并准备运行\nrunnable = model.optimize().to_runnable()\n\n# 创建输入数据 (需符合模型输入形状)\nimport numpy as np\ninput_data = np.zeros((1, 3, 224, 224), dtype=np.float32)\n\n# 执行推理\noutputs = runnable.run([input_data])\nprint(outputs[0].shape)\n```\n\n> **提示**：更多复杂示例（如 BERT、ResNet、TensorFlow 模型转换）请参考官方仓库的 `examples\u002F` 目录。","一家智能音箱初创团队需要在资源受限的嵌入式 Linux 设备上部署语音唤醒模型，以实现离线快速响应。\n\n### 没有 tract 时\n- **依赖沉重**：传统推理引擎（如 TensorFlow Lite 完整版）体积庞大，占用大量存储空间，导致固件更新困难。\n- **环境复杂**：需要配置复杂的 Python 运行时或 C++ 依赖库，在交叉编译到 ARM 架构时频繁遇到链接错误。\n- **启动缓慢**：模型加载和初始化耗时过长，用户喊出唤醒词后需等待数百毫秒才能开始识别，体验卡顿。\n- **内存泄漏风险**：通用框架在长期运行的嵌入式场景中容易出现内存管理问题，导致设备运行几天后死机。\n\n### 使用 tract 后\n- **极致轻量**：tract 作为纯 Rust 编写的自包含库，去除了所有冗余依赖，将推理引擎体积压缩至兆字节级别，轻松嵌入固件。\n- **部署简单**：直接利用 Rust 强大的交叉编译能力，一键生成针对特定芯片优化的二进制文件，无需处理繁琐的环境配置。\n- **即时响应**：得益于针对性的图优化和无垃圾回收机制，模型启动时间缩短至毫秒级，实现了“喊即应”的流畅体验。\n- **稳定可靠**：Rust 的内存安全特性彻底杜绝了内存泄漏隐患，确保设备在 7x24 小时不间断运行下依然稳如磐石。\n\ntract 通过极简的架构和 Rust 的性能优势，让高精度神经网络在低算力边缘设备上也能跑得轻快且稳定。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsonos_tract_f8adc41b.png","sonos","Sonos, Inc.","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fsonos_72df0125.png","The Wireless Hi-Fi system",null,"https:\u002F\u002Fwww.sonos.com","https:\u002F\u002Fgithub.com\u002Fsonos",[80,84,88,92,96,100,104,108,112,116],{"name":81,"color":82,"percentage":83},"Rust","#dea584",85.5,{"name":85,"color":86,"percentage":87},"Cuda","#3A4E3A",3.8,{"name":89,"color":90,"percentage":91},"Go Template","#00ADD8",3.1,{"name":93,"color":94,"percentage":95},"Metal","#8f14e9",2.5,{"name":97,"color":98,"percentage":99},"Assembly","#6E4C13",2.2,{"name":101,"color":102,"percentage":103},"Python","#3572A5",1.2,{"name":105,"color":106,"percentage":107},"Shell","#89e051",1,{"name":109,"color":110,"percentage":111},"C","#555555",0.7,{"name":113,"color":114,"percentage":115},"JavaScript","#f1e05a",0,{"name":117,"color":118,"percentage":115},"Dockerfile","#384d54",2859,252,"2026-04-07T17:59:14","NOASSERTION",4,"Linux, 嵌入式目标 (Embedded targets)","未说明 (主要面向 CPU 推理，支持 Arm Cortex-M, Armv6\u002F7\u002F8 NEON 等架构)","未说明",{"notes":128,"python":129,"dependencies":130},"该工具是基于 Rust 开发的神经网络推理引擎。核心运行依赖 Rust 编译器 (版本需 >= 1.91.0)。虽然提供 Python 绑定，但底层主要由 Rust 实现。不支持 TensorFlow 2.x 的直接加载，需先转换为 ONNX 格式。对 ONNX 中的 Tensor Sequences 和 Optional Tensors 算子支持有限。特别适合在资源受限的设备（如 Raspberry Pi, Arm Cortex-M 微控制器）上进行 CPU 推理。","支持 Python 绑定 (具体版本未在文本中明确限制，通常跟随 PyPI 标准)",[131,132,133,134,135],"rustc >= 1.91.0","ONNX (支持算子集 9-18)","NNEF","TensorFlow 1.x (有限支持)","PyTorch (需转换为 ONNX)",[14],[138,139,140,141,142,143],"tensorflow","onnx","neural-networks","artificial-intelligence","rust-library","rust","2026-03-27T02:49:30.150509","2026-04-08T12:11:34.129479",[147,152,157,162,167,172,177],{"id":148,"question_zh":149,"answer_zh":150,"source_url":151},24191,"如何在输入形状（如批次大小和序列长度）动态变化的情况下优化并运行模型？","如果输入形状在构建时未知，直接调用 `into_optimized()` 会导致错误。解决方案是：\n1. 不要立即调用 `into_optimized()`，而是先调用 `into_runnable()` 创建一个未优化的可运行模型。\n2. 这样得到的模型类型为 `SimplePlan\u003CInferenceFact, ...>`，支持动态形状推理。\n3. 注意：未优化的模型性能可能较低，且无法直接序列化存储用于后续加载，需在每次运行时重新构建或根据具体需求权衡是否固定输入形状。","https:\u002F\u002Fgithub.com\u002Fsonos\u002Ftract\u002Fissues\u002F300",{"id":153,"question_zh":154,"answer_zh":155,"source_url":156},24192,"运行 NNEF 模型时遇到 'Undetermined symbol in expression: N' 错误怎么办？","该错误通常是因为模型中存在未确定的符号维度（如 'N'）。解决方法是在运行命令中显式设置该符号的值。例如，在使用命令行工具时，添加 `--set N=1` 参数：\n`tract image.nnef.tar --nnef-tract-core --nnef-tract-onnx -i input:1,3,224,224,f32 --allow-random-input --set N=1`\n仅使用 `-i` 指定输入事实有时不足以解决符号未定问题，必须使用 `--set` 明确赋值。","https:\u002F\u002Fgithub.com\u002Fsonos\u002Ftract\u002Fissues\u002F742",{"id":158,"question_zh":159,"answer_zh":160,"source_url":161},24193,"遇到 'Unimplemented(Mean)' 或 'GlobalAveragePooling1D' 不支持的错误如何处理？","这通常是因为 Tract 尚未完全支持某些 TensorFlow\u002FKeras 特有的操作（如 `Mean` 用于全局平均池化）。\n目前的现状是：\n1. 维护者暂无计划直接支持 `.tflite` 格式作为输入。\n2. 对于量化网络，情况较为复杂，建议关注 ONNX 量化算子的支持进展。\n3. 可以尝试在导出模型前，将不支持的操作转换为 Tract 支持的标准 ONNX 算子，或者在 Python 端预处理模型结构。","https:\u002F\u002Fgithub.com\u002Fsonos\u002Ftract\u002Fissues\u002F182",{"id":163,"question_zh":164,"answer_zh":165,"source_url":166},24194,"模型加载时报错 'Unimplemented(RandomNormalLike)' 是因为缺少算子支持吗？","不一定。虽然报错显示 `RandomNormalLike` 未实现，但在某些案例（如 Stable Baselines3 的 SAC 模型）中，实际问题出在模型调用方式上。\nONNX 导出的模型可能包含随机噪声生成节点，但在实际推理时，框架（如 PyTorch）会对输出进行缩放或其他后处理。\n解决方案：检查原始框架（如 stable_baselines3）的源代码，确认是否需要对模型输出进行额外的缩放（scaling back）或后处理步骤。一旦在 Rust 代码中复现这些后处理逻辑，模型即可正常工作，无需等待算子支持。","https:\u002F\u002Fgithub.com\u002Fsonos\u002Ftract\u002Fissues\u002F895",{"id":168,"question_zh":169,"answer_zh":170,"source_url":171},24195,"如何提升 Tract 在移动设备（Android\u002FiOS）或 WebAssembly 上的推理性能？","性能优化取决于后端配置：\n1. 在 Android 和 iOS 上，Tract 默认通常使用 `arm64simd (generic)` 指令集。确保日志中显示已启用正确的 SIMD 优化。\n2. 对于 WebAssembly (Wasm)，启用 `simd` 特性通常能带来显著的速度提升，但可能仍低于原生模型性能。\n3. 尝试使用最新的开发版本（current head），因为新版本可能在操作融合（fusing operations）方面有改进。\n4. 注意：量化模型（如 i8xu8）的支持仍在完善中，目前可能不如浮点模型稳定或快速。","https:\u002F\u002Fgithub.com\u002Fsonos\u002Ftract\u002Fissues\u002F413",{"id":173,"question_zh":174,"answer_zh":175,"source_url":176},24196,"BERT 模型需要哪些特定的算子支持？","运行 BERT 架构通常需要支持 `OneHot` 等算子。虽然部分算子可能未在旧版本中实现，但它们通常作为 ONNX 原生算子较易添加。\n如果遇到缺失算子，建议：\n1. 检查使用的 Tract 版本是否已更新支持相关 ONNX 标准算子。\n2. 参考 `onnx\u002Fmodels` 仓库中的 BERT 示例，确认具体需要的算子列表。\n3. 如果是自定义算子，可能需要手动实现或转换模型结构以规避不支持的操作。","https:\u002F\u002Fgithub.com\u002Fsonos\u002Ftract\u002Fissues\u002F331",{"id":178,"question_zh":179,"answer_zh":180,"source_url":156},24197,"为什么优化图形时会失败并提示形状不统一（Trying to substitute a N... by 1...）？","这通常发生在输入事实传播（input fact propagation）不一致时。当模型中存在符号维度（如 N）且在优化阶段未能正确解析为具体数值（如 1）时，会导致形状替换失败。\n解决方法：\n1. 确保在运行优化前，通过 `--set` 参数或代码中的所有符号维度都已赋予具体整数值。\n2. 检查输入事实（Input Fact）的定义是否与模型内部推导的形状完全兼容。\n3. 避免在符号未定的情况下强行执行图优化（optimize stage）。",[182,186,190,194,198,202,206,210,214,218,222,226,230,234,238,242,246,250,254,258],{"id":183,"version":184,"summary_zh":76,"released_at":185},145781,"v0.23.0-dev.3","2026-03-20T12:41:26",{"id":187,"version":188,"summary_zh":76,"released_at":189},145782,"0.21.15","2026-03-09T08:30:24",{"id":191,"version":192,"summary_zh":76,"released_at":193},145783,"0.22.1","2026-02-23T15:35:33",{"id":195,"version":196,"summary_zh":76,"released_at":197},145784,"0.21.14","2026-02-23T15:24:08",{"id":199,"version":200,"summary_zh":76,"released_at":201},145785,"0.23.0-dev.2","2026-02-18T09:29:04",{"id":203,"version":204,"summary_zh":76,"released_at":205},145786,"0.22.0","2025-08-26T15:14:54",{"id":207,"version":208,"summary_zh":76,"released_at":209},145787,"0.21.13","2025-05-15T14:04:40",{"id":211,"version":212,"summary_zh":76,"released_at":213},145788,"0.21.12","2025-04-10T08:46:43",{"id":215,"version":216,"summary_zh":76,"released_at":217},145789,"0.21.11","2025-03-19T14:54:39",{"id":219,"version":220,"summary_zh":76,"released_at":221},145790,"0.21.10","2025-02-21T13:27:46",{"id":223,"version":224,"summary_zh":76,"released_at":225},145791,"0.21.9","2025-01-08T16:00:08",{"id":227,"version":228,"summary_zh":76,"released_at":229},145792,"0.21.8","2024-12-05T10:46:36",{"id":231,"version":232,"summary_zh":76,"released_at":233},145793,"0.21.7","2024-09-23T13:13:37",{"id":235,"version":236,"summary_zh":76,"released_at":237},145794,"0.21.6","2024-07-24T07:28:51",{"id":239,"version":240,"summary_zh":76,"released_at":241},145795,"0.21.5","2024-05-13T07:14:34",{"id":243,"version":244,"summary_zh":76,"released_at":245},145796,"0.21.4","2024-04-23T11:20:38",{"id":247,"version":248,"summary_zh":76,"released_at":249},145797,"0.21.3","2024-04-03T17:46:30",{"id":251,"version":252,"summary_zh":76,"released_at":253},145798,"0.21.2","2024-03-29T12:39:08",{"id":255,"version":256,"summary_zh":76,"released_at":257},145799,"0.21.1","2024-02-08T18:27:43",{"id":259,"version":260,"summary_zh":76,"released_at":261},145800,"0.21.0","2024-01-16T15:30:38"]