A simple example of how to build an iOS client for TensorFlow Serving. I hope this project will help developers understand how to build clients and be a good starting point for building their own iOS projects.
To run the example project, clone the repo, and run pod install
from the Example directory first.
TensorFlowServing-InceptionClient is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "TensorFlowServing-InceptionClient"
You can set up a server by following the instructions on the TensorFlow Serving site:
https://www.tensorflow.org/deploy/tfserve https://tensorflow.github.io/serving/setup https://tensorflow.github.io/serving/docker
I have a prebuilt Docker container available here:
docker pull mountaintom/tensorflow-serving-inception-docker-swarm-demo
This container has the Inception model already loaded and ready to go.
Start this container and run the following commands within it to get the server running:
$ cd /serving
$ bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server --port=9000 --model_name=inception --model_base_path=inception-export &> inception_log &
A longer article on setting up a server is here:
There are a few refinements I plan to add to this project, as they are properly tested. The protobuf files may need to be recompiled if your version of Protocol Buffers does not match the one I used. I will put back the automatic proto file complilation as soon as it is tested.
In the meantime the protofiles may be compiled as follows:
From the Example directory:
cd ../TensorFlowServing-InceptionClient/Classes/third_party/ ;
find . -name "*.proto" -exec \
../../../Example/Pods/\!ProtoCompiler/protoc \
--objc_out=. \
-I . \
{} \;
find . -name "*_service.proto" -exec \
../../../Example/Pods/\!ProtoCompiler/protoc \
--plugin=protoc-gen-grpc=../../../Example/Pods/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin \
--grpc_out=. \
-I . \
{} \;
cd -;
Tom Stall, <mtm<@>mountaintom<.>com>
TensorFlowServing-InceptionClient is available under the MIT license. See the LICENSE file for more info.
..