A Guide to Running Tensorflow Models on Android

Let’s create an Android app that uses a pre-trained Tensorflow image classifier for MNIST digits to recognize what the user draws on the screen. We’ll use Android Studio and the gradle build system to make it happen.

Code for this video:

Please subscribe! And like. And comment. That’s what keeps me going.

More learning…


  1. Hi Siraj I am a Spanish student and I am trying to develop a Skin Disease Detector for Android. I just wanted you to know we are going to get married as soon as possible. Thank you very much.

  2. Hi, I'm not able to run this code. In the trainning code there is one error 'module 'tensorflow_core._api.v2.train' has no attribute 'Saver'. Thanks'

  3. I swear it feels like he hasnt coded it himself… i am soo confused main parts of this video are not explained…. how is model actually intergrated into andorid studio ?!

  4. I think this is one of the best guides I've ever seen. You have something special!! Thank you, seriously it has been very useful

  5. Hey Siraj! I absolutely love your videos and your personality.
    This is the only thing I can find of substance Regarding Android and ML.
    How is that possible?
    The biggest industries in tech, Mobile and AI and they have TONs of uses I imagine but we haven't imagined them yet.
    Please do more about Mobile and AI and maybe an observational video about what we might expect?
    Thanks again my dude!

  6. sir how to implement tensorflow in android such that on scanning book cover it should show its review with purchase link .Any help will be greatful

  7. hey Siraj I have a question on this tutorial I know it is old but I need it …….when you export those trained files(Keras .pb file) I did not see you write the code for the label part but were they are on the android asset file ……plz show me how I really need that point plzzzzzzzzzzzzzzzz

  8. can you make series of videos of tensorflow on android like sentdex…

  9. Hey @siraj, it would be great if you make a tutorial on how to make specific object detection Android app based on tensor flow because many guys need it.

  10. Hey Siraj, do you have a video on real time object detection for Android application using tensor flow?

  11. This guide was published in 2017. Which changes would you make to a 2019 update?

  12. Hi.in new model of samsung mobile we have very high performance of device. So do we can use that to all of this process, and goodbyes laptop and any large machine to learning machine??

  13. I I try to convert h5 model "Keras to Tensorflow" model .pb when I try to use it in my Android application I have this error " input must be 4-dimensional[80,3,1]"

    Can you help me

  14. How to determine what is input and output names ? they always give error as not in the graph.

  15. To export to a .pb model, is input_node_names always equal to ["conv2d_1_input"] regardless of how many layers you have? Is output_node_name always equal to the number of Dense layers plus the output activation function that was used?

Leave a Reply

Your email address will not be published. Required fields are marked *