From 0ae2c5391c87cf038cea95419bcc7bc9b86b0df2 Mon Sep 17 00:00:00 2001 From: Ansh Rai Date: Sun, 6 Sep 2026 12:54:05 +0000 Subject: [PATCH] mlearning/tflite-micro: Register DEPTHWISE_CONV_2D in tflm_tool resolver. MicroMutableOpResolver<8> only registered 8 ops, missing DEPTHWISE_CONV_2D, required by any depthwise-separable CNN (MobileNet-style, DS-CNN keyword-spotting models). The kernel already exists upstream (Register_DEPTHWISE_CONV_2D_INT8() in tensorflow/lite/micro/kernels/depthwise_conv.h); this wires it into the resolver and bumps the template size to <9>. Verified with micro_speech_quantized.tflite on sim:tflm. Before: Didn't find op for builtin opcode 'DEPTHWISE_CONV_2D'. After: RESHAPE/DEPTHWISE_CONV_2D/FULLY_CONNECTED/SOFTMAX all execute. Signed-off-by: Ansh Rai --- mlearning/tflite-micro/tflm_tool.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mlearning/tflite-micro/tflm_tool.cc b/mlearning/tflite-micro/tflm_tool.cc index 8edcf45a4..200df5391 100644 --- a/mlearning/tflite-micro/tflm_tool.cc +++ b/mlearning/tflite-micro/tflm_tool.cc @@ -110,8 +110,9 @@ extern "C" int main(int argc, FAR char* argv[]) /* HACK: can change operators here. */ - tflite::MicroMutableOpResolver<8> resolver; + tflite::MicroMutableOpResolver<9> resolver; resolver.AddConv2D(tflite::Register_CONV_2D_INT8()); + resolver.AddDepthwiseConv2D(tflite::Register_DEPTHWISE_CONV_2D_INT8()); resolver.AddMaxPool2D(tflite::Register_MAX_POOL_2D_INT8()); resolver.AddQuantize(tflite::Register_QUANTIZE_FLOAT32_INT8()); resolver.AddDequantize(tflite::Register_DEQUANTIZE_INT8());