tensorflow / tflite-micro

Infrastructure to enable deployment of ML models to low-power resource-constrained embedded targets (including microcontrollers and digital signal processors).
Apache License 2.0
1.87k stars 809 forks source link

Stream interface support for KWS model? #2707

Open ctwillson opened 2 weeks ago

ctwillson commented 2 weeks ago

Can TFLM support stream mode for KWS as this paper told.It is necessary for microcontroller to reduce the lantecy

rascani commented 2 weeks ago

Yes, TFLM supports everything necessary for KWS. KWS uses resource variables to store persistent state, so you'll need to construct a MicroInterpreter with a MicroResourceVariables object (it defaults to null). Then it is simply a matter of calling MicroInterpreter::Invoke() for each iteration.

ctwillson commented 1 week ago

Yes, TFLM supports everything necessary for KWS. KWS uses resource variables to store persistent state, so you'll need to construct a MicroInterpreter with a MicroResourceVariables object (it defaults to null). Then it is simply a matter of calling MicroInterpreter::Invoke() for each iteration.

Thanks for your reply,It's a bit difficult for beginners. I just want to focus on train my kws model by python code from google-research.Can this python code can convert to tensorflow micro?

ctwillson commented 1 week ago

@rascani Another question:How to train a Streaming model by tensorflow?

ctwillson commented 5 days ago

Anyone can help me?There is no demo code for stream model. I trained a stream model by google-research kws,there has a infrence demo code,I try to coverted it to TFLM,but TFLM API is not same as TF Lite.