MycroftAI / mycroft-precise

A lightweight, simple-to-use, RNN wake word listener
Apache License 2.0
836 stars 227 forks source link

Is it possible to convert .pb file to tflite? #187

Open EuphoriaCelestial opened 3 years ago

EuphoriaCelestial commented 3 years ago

Hi, I have finished training my own wake word model and exported .pb and .pb.params files. It worked very well, nice work guys, thank you! But I want it to run on Android devices too. As far I as know, it should be in tflite format to be able to run on low energy chips on Android devices; so, questions is how can I do that? If it is not possible to convert to tflite, is there any trick to run the .pb model on Android OS?

MatthewScholefield commented 3 years ago

Try using the code from the tensorflow 2 PR. It includes support for tflite. Note, however, that the computation graph of the model expects MFCC features as inputs meaning after you get the tflite model running on Android you will need to port this computation.