Logo vun Tflite Micro Integration

Tflite Micro Integration

Communautéit
easyzoom
tflite-micro-integration

Use when integrating or debugging TensorFlow Lite Micro (LiteRT) on MCUs — op resolver, tensor arena sizing, AllocateTensors, Invoke, int8 quantization, and missing-op errors

Iwwersiicht

Editeureasyzoom
Repositoryaix-skills
Skill-Nummtflite-micro-integration
Stären
39
Forks
5
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum easyzoom op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Tflite Micro Integration an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/easyzoom/aix-skills/tree/main/skills/tflite-micro-integration
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/easyzoom/aix-skills.git /tmp/aix-skills
mkdir -p .claude/skills
cp -r /tmp/aix-skills/skills/tflite-micro-integration .claude/skills/tflite-micro-integration
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Tflite Micro Integration an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Tflite Micro Integration automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Tflite Micro Integration net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

TensorFlow Lite Micro Integration

Overview

Use this skill to bring up TensorFlow Lite for Microcontrollers (TFLM / LiteRT for Microcontrollers) on an MCU: register exactly the ops the model uses, size the tensor_arena correctly, and quantize inputs so Invoke() returns valid output. Most failures are missing ops, an undersized arena, or unquantized input, not model logic. TFLM is Google's official microcontroller runtime and is integrated by several vendor toolchains — Espressif esp-tflite-micro (with ESP-NN kernels), NXP eIQ, and ST X-CUBE-AI, where TFLM is available as an optional runtime alongside ST's own proprietary Cube.AI runtime. Use tinymaix-integration instead when you want a lighter, dependency-free runtime.

When To Use

Use this skill when:

  • The user runs tensorflow/tflite-micro and works with tflite::MicroInterpreter, tflite::MicroMutableOpResolver, AllocateTensors(), or Invoke().
  • The build or runtime hits Didn't find op for builtin opcode 'CONV_2D', 'QUANTIZE', arena/AllocateTensors failures, or output that is all zeros or drifting.
  • The project embeds a .tflite model as a C array (xxd -i) and needs int8 scale/zero_point handling.

Do not use this skill when the model is not yet converted and quantized to .tflite; run the TFLite converter and validate on the host first.

First Questions

Ask for:

  • Target core, RAM/flash, and toolchain; whether CMSIS-NN / ESP-NN / vendor kernels are used.
  • The .tflite model, its op list (from Netron or flatc), and its input/output dtype (int8, uint8, or float32).
  • Current kTensorArenaSize and whether AllocateTensors() returns kTfLiteOk.
  • Input scale/zero_point and expected output; a known golden input/output pair.
  • Exact symptom: link error, missing-op error, allocation failure, or wrong output.

Integration Checklist

  1. Convert and embed the model. Produce a quantized .tflite, then xxd -i model.tflite > model.cc. Reference it via tflite::GetModel(g_model) and check model->version() != TFLITE_SCHEMA_VERSION.

  2. Register only the needed ops. Use tflite::MicroMutableOpResolver<N> where N matches the exact count of AddConv2D(), AddDepthwiseConv2D(), AddFullyConnected(), AddReshape(), AddSoftmax(), AddQuantize(), etc. AllOpsResolver (which registers all built-in ops) bloats flash; avoid it in production.

  3. Allocate the tensor arena. Declare alignas(16) uint8_t tensor_arena[kTensorArenaSize];, construct tflite::MicroInterpreter with the model, resolver, tensor_arena, and kTensorArenaSize, then use MicroPrintf for logging.

  4. Allocate tensors and check the code. Call interpreter.AllocateTensors() and confirm it returns kTfLiteOk. Grow kTensorArenaSize if it fails, then trim toward interpreter.arena_used_bytes().

  5. Quantize the input. Read input->params.scale and input->params.zero_point, compute q = round(real / scale) + zero_point, clamp to [-128, 127], and write input->data.int8[i].

  6. Invoke and dequantize. Check interpreter.Invoke() == kTfLiteOk, then convert output->data.int8[i] back with real = (q - zero_point) * scale.

Common Failures

  • Didn't find op for builtin opcode 'CONV_2D' / 'QUANTIZE': op missing from the resolver, or N in MicroMutableOpResolver<N> too small to hold all Add* calls.
  • Opcode version mismatch (same message with version 'N' plus "An older version of this builtin might be supported"): model exported by a newer converter than the runtime; rebuild tflite-micro or re-export.
  • AllocateTensors() fails or returns non-kTfLiteOk because kTensorArenaSize is too small.
  • Output is all zeros or drifts: input written as raw floats/pixels without applying scale/zero_point.
  • Hard fault or stack overflow inside AllocateTensors()/Invoke(): give the calling thread enough stack (typically several KB).
  • Unaligned or too-small tensor_arena (missing alignas(16)) causing allocation errors.

Verification

Before claiming TFLM inference works:

  • State the model, its op list, input/output dtype, and kTensorArenaSize vs arena_used_bytes().
  • Confirm AllocateTensors() and Invoke() both return kTfLiteOk.
  • Confirm a golden input reproduces the host reference output within quantization tolerance.
  • Confirm input quantization and output dequantization use the tensor's actual scale/zero_point.

Example

User:

text
TFLM 里 Invoke 报 "Didn't find op for builtin opcode 'DEPTHWISE_CONV_2D'"。

Agent:

  1. Asks for the model op list (Netron/flatc) and the current MicroMutableOpResolver<N> registrations.
  2. Adds resolver.AddDepthwiseConv2D() and bumps N to match the total Add* count.
  3. Re-runs, confirms AllocateTensors() and Invoke() return kTfLiteOk, and checks a golden vector.

Heefeg gestallte Froen

Wat mécht de KI-Skill Tflite Micro Integration?

Use when integrating or debugging TensorFlow Lite Micro (LiteRT) on MCUs — op resolver, tensor arena sizing, AllocateTensors, Invoke, int8 quantization, and missing-op errors

Firwat Tflite Micro Integration op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Tflite Micro Integration besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Tflite Micro Integration an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/easyzoom/aix-skills/tree/main/skills/tflite-micro-integration an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Tflite Micro Integration benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Tflite Micro Integration benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Tflite Micro Integration domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Tflite Micro Integration gratis?

Jo. De Skill gëtt vum easyzoom ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇