TF Lite Retraining on Mobile - tensorflow

Let's assume I made an app that has machine learning in it using a tflite file.
Is it possible that I could retrain this model right inside the app?
I have tried to use the Model Maker which is provided by TensorFlow, but, without this, i don't think there's any other way to retrain your model with just the app i made.

Do you mean training on the device when the app is deployed? If yes, TFLite currently doesn't support training in general. But there's some experimental work in this direction with limited support as shown by https://github.com/tensorflow/examples/blob/master/lite/examples/model_personalization.
Currently, the retraining of a TFLite model, as you found out w/ Model Maker, has to happen offline w/ TF before the app is deployed.

Related

How to use the models under tensorflow/models/research/object_detection/models?

I'm looking into training an object detection network using Tensorflow, and I had a look at the TF2 Model Zoo. I noticed that there are noticeably less models there than in the directory /models/research/models/, including the MobileDet with SSDLite developed for the jetson xavier.
To clarify, the readme says that there is a MobileDet GPU with SSDLite, and that the model and checkpoints trained on COCO are provided, yet I couldn't find them anywhere in the repo.
How is one supposed to use those models?
I already have a custom-trained MobileDetv3 for image classification, and I was hoping to see a way to turn the network into an object detection network, in accordance with the MobileDetv3 paper. If this is not straightforward, training one network from scratch could be ok too, I just need to know where to even start from.
If you plan to use the object detection API, you can't use your existing model. You have to choose from a list of models here for v2 and here for v1
The documentation is very well maintained and the steps to train or validate or run inference (test) on custom data is very well explained here by the TensorFlow team. The link is meant for TensorFlow version v2. However, if you wish to use v1, the process is fairly similar and there are numerous blogs/videos explaining how to go about it

Tensorflow vs Tensorflow Lite for mobile apps ML data pipeline

I want to build a ML data pipeline for a recommender system in a dating mobile app.
Currently, I am in a very early stage trying to figure out the infrastructure but I am confused with tensorflow and tensorflow lite.
Can I build the system using tensorflow and then after training, hyperparameter tuning etc. deploy the model in backend?
Is it mandatory to use tensorfow lite whenever wanting to use ML for mobile or that is used only when you actually want to train the model in a phone device?
TensorFlow Lite is mainly for inference use cases. After training TF models in the desktop/server side, you can convert the trained TF model to the corresponding TensorFlow Lite model to deploy them to mobile with some techniques, for example, quantizations.

I want to learn about TensorFlowInferenceInterface which is used to create tensorflow apps. What sources can trusted?

I am working on project Audio classifier app. I am beginner in java Also if some one can help me figure out how to extract MFFC features from audio signal I would like give them credit,also provide me contact details if you are interested.
In Android, you can use TensorFlow Lite , a lightweight solution for TensorFlow.
You can convert a TensorFlow model, or Keras model to a TF Lite model ( .tflite ). See here.
This TF Lite model could be inferenced on an Android or iOS device using the TF Lite's Java and Swift API.
It may not support some layers like LSTM or BatchNormalization. Dense and all Conv layers work well.
Another method is using Tensorflow Mobile.
TensorFlow Mobile runs a protocol buffers file ( .pb ). It has been deprecated but can be still used. But, Google suggests its developers to use TF Lite.
You can find a complete tutorial here.

How to retrieve original TensorFlow frozen graph from .tflite?

Basically I am trying to use google's pre trained Speaker-id model for speaker detection. But this being a TensorFlow Lite model, I can't use it on my Linux pc. For that, I am trying to find a converter back to its frozen graph model.
Any help on this converter or any direct way to use tensorflow Lite pretrained models on desktop itself, will be appreciated.
You can use the converter which generates tflite models to convert it back to a .pb file if that is what you're searching for.
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/lite/toco/g3doc/cmdline_examples.md

How do we deploy a trained tensorflow model on a mobile device?

One of the highlights of tensorflow appears to be "true portability" - seamless deployment of trained models across different platforms - especially running a trained model on a mobile device? Do you have an example or some tutorial that walks through how a trained tensorflow model can be packaged and executed within a mobile app?
The TensorFlow repository includes an example Android application that uses the mobile device camera as a data source, and the Inception image classification model for inference. The source can be found here, and the repository includes both the full source code and a link to download a trained model.
The model is the Inception model that won Imagenet’s Large Scale Visual Recognition Challenge in 2014.