Code Monkey home page Code Monkey logo

Comments (28)

petewarden avatar petewarden commented on April 18, 2024 20

I'm working with the protobuf team to get protocolbuffers/protobuf#1500 in, so we can update protobuf in TensorFlow and get iOS support checked in.

from tensorflow.

anabatchian avatar anabatchian commented on April 18, 2024 8

Hi, does this support GPU computation on iOS?

from tensorflow.

petewarden avatar petewarden commented on April 18, 2024 6

Just a comment on the progress. We were blocked on a build issue for quite a while, but with the latest release of Bazel (0.2.2) we have linkopts which we hope should let us get #1631 integrated soon.

from tensorflow.

karthiksekarnz avatar karthiksekarnz commented on April 18, 2024 2

@petewarden I may sound dumb, can you give me an example use case of having the machine learning on an ios client, please. How does the neuralnet learn when it's on an iOS client? Will the training data be only users' data i.e their photos, playlists etc. Does the neural net sit in the background and train itself with user's data like a cron? e.g it can understand user's preferences. Am I right in saying that this app won't have any global knowledge like on taking a picture of a vegetable it will classify it as brocolli without connecting to a pre-trained machine learning api hosted remotely?

from tensorflow.

petewarden avatar petewarden commented on April 18, 2024 1

@karthiksekarnz You can check out the TensorFlow for Poets codelab that should help you train your model:

https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/index.html?index=..%2F..%2Findex#0

from tensorflow.

petewarden avatar petewarden commented on April 18, 2024 1

It's not yet documented, but you can pass in "-Os" to the build_all_ios.sh script to compile an optimized version that should run in under a second.

from tensorflow.

petewarden avatar petewarden commented on April 18, 2024

Sorry about that Alex, we'll update the docs. We are actively working on iOS support, though I can't give a timeline I'm afraid.

from tensorflow.

kurtjacobsdev avatar kurtjacobsdev commented on April 18, 2024

@petewarden will you also be open sourcing the development of the iOS integration? i.e. will developers be able to contribute to the development?

from tensorflow.

petewarden avatar petewarden commented on April 18, 2024

Yes, we do plan on making it available as open source, and we'll welcome contributions!

from tensorflow.

kurtjacobsdev avatar kurtjacobsdev commented on April 18, 2024

awesome look forward to the day its open sourced!

from tensorflow.

bhack avatar bhack commented on April 18, 2024

@Woffle Meantime there is an initial Tensorflow javacpp-preset. Some of this presets generally can run on IOS through RoboVM. Follow also bytedeco/javacpp-presets#111

from tensorflow.

girving avatar girving commented on April 18, 2024

Reopening as a tracking bug.

from tensorflow.

aazout avatar aazout commented on April 18, 2024

@petewarden Any further update on this?

from tensorflow.

sahil912 avatar sahil912 commented on April 18, 2024

May I know, When will the tensor flow for iOS will be out? Any reference example that will help get started. Thanks

from tensorflow.

petewarden avatar petewarden commented on April 18, 2024

The documentation is still in progress, and we're still testing it, but you can build an iOS version of the library by using the new makefile system:

https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile

After that's built, the tensorflow/contrib/ios_examples folder has a couple of sample applications.

from tensorflow.

randomiser avatar randomiser commented on April 18, 2024

The example demo for iOS is very very slow in comparison with the Android version. Is there anything I can change within the demo code to improve the speed?

Also the match percentages vary wildly. On Android it with report accuracy levels about 70% sometimes but I can't get it above about 15% on iOS. I'm using the same files for both.

from tensorflow.

StephenOman avatar StephenOman commented on April 18, 2024

@karthiksekarnz I understand that the architecture for a photo recognition app on mobile client is that a pre-trained model is bundled with the app and downloaded by the user from an app store. The app then runs an inference on the neural network (i.e. graph execution) only. There is no learning capability as yet in the mobile app.

I suspect that this approach is taken because a mobile phone doesn't have enough computing power to do learning efficiently, given that lots of models are built with multi-GPUs. But that remains to be seen because the TensorFlow public C++ API doesn't yet support the wide range of network training capabilities that the Python API does.

It's also probably true that to transfer images from the camera's video stream to a server in real-time would be a bandwidth hog. If the user was on a cellular network, it may also be expensive, depending on their bundle.

It's an interesting architecture problem though. Lots of interesting data that could be modelled will be captured by phones, but the learning has to be server based at the moment.

from tensorflow.

karthiksekarnz avatar karthiksekarnz commented on April 18, 2024

@StephenOman that pretty much answers my question
I came across this PR after exploring about Google's Vision API and machine learning API.
I am looking for a client based approach to do object classification, precisely food items. I was thinking about the bandwidth issue as well, i don't want to go over the wire to just find out the scanned picture is broccoli.

I definitely don't want to be that app, that eats all the device memory to just learn data, didn't know I can bundle the neural network with data model.

Now I need to find out about how to train the neural net to classify food items and how to bundle the pre-trained data model with the app, thank you so much :)

from tensorflow.

sahil912 avatar sahil912 commented on April 18, 2024

@petewarden Hey, I tried to run the sample iOS examples, in tensflow directory, but I am getting
#include "eigen-eigen-d02e6a705c30/unsupported/Eigen/CXX11/Tensor"
and
also libprotobuf-lite.a and libprotobuf.a files are missing.

Any help would be greatly apprciated, Thanks

from tensorflow.

petewarden avatar petewarden commented on April 18, 2024

@sahil912 That sounds like you don't have things built correctly. Can you try running the tensorflow/contrib/makefile/build_all_ios.sh script?

from tensorflow.

ningxusc avatar ningxusc commented on April 18, 2024

I was running the simple example on iphone6, and it took about 4 second to classify the example image, is this expected?

from tensorflow.

petewarden avatar petewarden commented on April 18, 2024

Since we now have build support in tensorflow/contrib/makefile, and examples in tensorflow/contrib/ios_examples, I'm closing this bug.

from tensorflow.

randomiser avatar randomiser commented on April 18, 2024

Hi there, Thanks for the information on building an optimised version. Just curious but why isn't this the default for the sample iOS projects? When I've shown people the iOS demo they've all remarked on the slowness vs Android. Finally to build the optimised version do I just run:

> ./build_all_ios.sh -Os

This made no difference in my testing,
Thanks in advance.

from tensorflow.

StephenOman avatar StephenOman commented on April 18, 2024

@randomiser The build_all_ios.sh script currently ignores the command line parameters. So instead, you need to run the compile_ios_tensorflow.sh script:

tensorflow/contrib/makefile/compile_ios_tensorflow.sh "-Os"

Note that this gcc flag optimises the library for size, making the app footprint smaller (see #2716). For speed optimisation, gcc accepts an -O3 flag. So this command should build a faster execution library, at the cost of a bigger memory footprint:

tensorflow/contrib/makefile/compile_ios_tensorflow.sh "-O3"

Although I haven't actually tested that assertion.

from tensorflow.

randomiser avatar randomiser commented on April 18, 2024

Thanks Stephen for those extra details. Will try it now and see how I get on.

from tensorflow.

petewarden avatar petewarden commented on April 18, 2024

Based on this discussion I actually updated the build_all_ios.sh script to use "-Os" by default, and to build in parallel to lower overall compile times:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/makefile/build_all_ios.sh#L32

from tensorflow.

SoumyaMaitra avatar SoumyaMaitra commented on April 18, 2024

Hi
Is there any update on tensorflow/core/framework/types.pb.h not found on iOS compile?

from tensorflow.

User2004 avatar User2004 commented on April 18, 2024

https://webappcodes.com/category/ios

Here, above link you find all ios example codes

from tensorflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.