Comments (28)
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.
Hi, does this support GPU computation on iOS?
from tensorflow.
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.
@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.
@karthiksekarnz You can check out the TensorFlow for Poets codelab that should help you train your model:
from tensorflow.
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.
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.
@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.
Yes, we do plan on making it available as open source, and we'll welcome contributions!
from tensorflow.
awesome look forward to the day its open sourced!
from tensorflow.
@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.
Reopening as a tracking bug.
from tensorflow.
@petewarden Any further update on this?
from tensorflow.
May I know, When will the tensor flow for iOS will be out? Any reference example that will help get started. Thanks
from tensorflow.
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.
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.
@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.
@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.
@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.
@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.
I was running the simple example on iphone6, and it took about 4 second to classify the example image, is this expected?
from tensorflow.
Since we now have build support in tensorflow/contrib/makefile, and examples in tensorflow/contrib/ios_examples, I'm closing this bug.
from tensorflow.
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.
@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.
Thanks Stephen for those extra details. Will try it now and see how I get on.
from tensorflow.
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.
Hi
Is there any update on tensorflow/core/framework/types.pb.h not found on iOS compile?
from tensorflow.
https://webappcodes.com/category/ios
Here, above link you find all ios example codes
from tensorflow.
Related Issues (20)
- Gradients can't be computed for keras embeddings HOT 4
- Hermetic Cuda doesn't respect really aarch64(Tegra devices) HOT 4
- check failed: !PyErr_Occurred() when constructing two uint64 tensors HOT 1
- TF_SelectV2Op gets legalized to TFL_SelectOp
- Wheels have different metadata on different platforms HOT 3
- TextVectorization returns 'int64' vs 'float32' in TF 2.7 / nightly + Training simple unigram/bigram models much slower than in 2.15 HOT 3
- How to pack TFRT into wheel? And use it in saved_model_cli. HOT 3
- Custom `tf.keras.metrics.Metric` example fails on GPU in TF 2.17 (but not on nightly): is it possible to get it to work on 2.17? HOT 3
- Bazel build fails on RISC-V (riscv64) architecture for TensorFlow 2.17.0 HOT 1
- MLIR quantizer produces asymmetric quantization for int16 activations
- Python Wheel generation of TensorFlow Lite 2.17 for ARMv7l 32 bits not working HOT 2
- Auto-Encoding Variational Bayes HOT 1
- traceback issue HOT 1
- An `aborted issue` could be raised in TensorFlow when I used API `math_ops.cast` and `array_ops.split` HOT 1
- Got one aborted issue when using `data_flow_ops.MapStagingArea` HOT 2
- Using `gen_random_index_shuffle_ops.random_index_shuffle` with `rounds=-2` can cause a crash HOT 1
- Using `fft_ops` would cause an `aborted issue` HOT 2
- `tf_cond.cond` and `tf.function` could cause an aborted issue HOT 1
- TensorFlow does not support AMD Graphics Cards on Windows HOT 2
- tf-nightly[and-cuda] depends on archived version of nvidia-cudnn-cu12==8.9.7.29 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorflow.