I'm new with tensorflow and I'm following this tutorial in youtube then I'm trying to train my own graph with the tensorflow deep learning method (using retrain.py file). I'have as result 2 files: one for labels and the other for the graph.
I'm trying to replace those two files with the same ones in the tensorflow demo application for android, but this didn't work for me.
I have read a bit about tensorflow on their website, but I found it complex for me as a beginner. Anyone can explain the problem to me please ???.
Related
how can I use the model from https://www.tensorflow.org/tutorials/audio/simple_audio in my Android app? How to provide inputs correctly and how to interpret outputs?
TensorFlow Lite's Task Library has an Audio Classification example for Android, which is what you might be looking for. The guide explains how the Java AudioClassifier API works.
The Task Library uses YAMNet for audio analysis, which has a pre-trained version on TFHub. If you want to train with your own dataset, please refer to the notebooks mentioned here.
I want to create a simple neural network based on the example https://github.com/googlesamples/android-ndk/tree/master/nn_sample. Is it possible to create this with the help on Tensorflow only with Android tools on Java
Take a look at this folder https://github.com/googlesamples/android-ndk/tree/master/nn_sample/app/src/main/cpp
simple_model.h is the model trained in Tensorflow before creating the Android project. Now the model likes black-box, get input and predict output only, if you want to build your own model, try this tutorial (All steps from training, evaluating, prediction to deploy onto Android):
https://medium.com/#elye.project/applying-tensorflow-in-android-in-4-steps-to-recognize-superhero-f224597eb055
Affirmative. You can use TensorFlow Lite on Android, it's an open source deep learning framework which helps to compress and deploy models to a mobile or embedded application. It basically can take models as input and then deploys and interpret and perform resource-conserving optimizations for mobile applications. The NNAPI of Android NDK can interface with TFLite easily too. This link contains gesture, image, object & speech detection and classification example implementations on Android with Java using TFLite.
After lots of research, find it out that it can be achieve by using TensorFlow SmartReply which will help to predict and give some response based on the input using machine language. But while integrating the same into my own android application, facing issue related to JNI libraries integration.It will be really helpful if someone has any sample or example code in this .
Followed the below link :-
https://github.com/tensorflow/tensorflow/tree/e1ac119417e6301222c2847f5f82e8ff093d7552/tensorflow/contrib/lite/models/smartreply
The sample app given by google for tensorflow on android is written in C++.
I have a tensorflow application written in python. This application currently runs on desktop. I want to move the application to android platform. Can I use bazel to build the application that is written in python directly for android? Thanks.
Also sample tensorflow app in python on android will be much appreciated.
Currently, there is no simple way to run tensorflow on android. Typically, you would only have to use inference (runtime), not training.
Another way is to use TensorFlow serving to host models in the cloud and issue RPC calls from an Android client.
I tried to use python in my android application with some 3rd party terminals like SL4A and Qpython. Those will support to run the python files directly in our android application so we have to install SL4A apk's and we need to call that intent.But these will support for some level I guess.
I tried to import tensorflow in that terminal it shows module not found. So I thought this tensorflow will not work in these terminals.
So I am trying to create one .pb file from the python files which are working in unix platform.So We need to include that output .pb file in our android application and we need to change the c++ code regarding that .pb file.I am thinking in this way.let see it will work or not.I will update soon if it working.
You can create your tensorflow model on your desktop and save it as a .pb file. Then you can add this model to your android project and make use of it to make predictions on the android device.
Its like training(which involves heavy computations) on a desktop machine(which is more powerful) and using the model to make predictions(which involves less computations) on a mobile device(comparatively less powerful).
This is a link to a great video by Siraj Raval
https://www.youtube.com/watch?v=kFWKdLOxykE
I created a Tensorflow image classification app in python 2.7 using Kivy and Pycharm. I used my own data to create a custom graph and labels file. The app works great and does what I want it to do. It took me months of learning and coding to get to this point. My last part of this "journey" has been trying to port the app to the android platform (I'd like to do Windows or a web app too -- but that does not seem to be a real option today . . .) I've created the Tensorflow Android Camera Demo app using Bazel and it worked fine on my Galaxy S5. However, after spending several long days searching all the references I could fine in Google searches, Packt (and other) books, and so on I am at an impasse. My question is does anyone in this forum have any advice on a method to create an Android app from a working Python app as I described? I would be really grateful for any help from someone who has done this.
I used my own data to create a custom graph and labels file
Since you have already trained your TensorFlow model, you can import it into an Android app relatively easily.
The TensorFlow Android demo app can now be built in Android Studio without using Bazel. You should be able to replace the Inception v3 image classifier model with your own model.
Check out my blog post here for more information about how to use the Java TensorFlowInferenceInterface class to interact with your pre-trained model:
https://medium.com/#daj/using-a-pre-trained-tensorflow-model-on-android-e747831a3d6
As for how to port a Python app to Android, I'm not aware of an easy way to do that.