TensorFlowServing-InceptionClient 0.0.7

TensorFlowServing-InceptionClient 0.0.7

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布最新发布2017 年 8 月

Tom Stall 维护。




  • Tom Stall

这是如何构建用于 TensorFlow Serving 的 iOS 客户端的简单示例。希望这个项目能帮助开发者了解如何构建客户端,并为构建他们自己的 iOS 项目提供一个良好的起点。

请注意

这是一个实际项目的占位符, projekt: https://github.com/mountaintom/TensorFlowServing-InceptionClient

如果从 Example 目录中克隆项目并运行 "pod install",演示将工作得很好。

然而,由于 Cocoapods 中的移动、混乱和目录树简化难以理解的各种组合,我还没有能够使其作为 Cocoapod 进行编译。当代码破解后,实际项目将在这里放置。

alt text

当使用 Objective-C 时,iOS gRPC 和 Protocol Buffers 可用于生产级别的工具和代码。存在对 Swift 的实验性支持。我将评估实验性工具以构建 Swift版本,除此之外的项目。

示例

要运行示例项目,首先从仓库克隆,然后从 Example 目录运行 pod install

要求

安装

TensorFlowServing-InceptionClient 通过 CocoaPods 提供。要安装,只需将以下行添加到您的 Podfile

pod "TensorFlowServing-InceptionClient"

设置测试服务器

您可以根据 TensorFlow Serving 站点的说明设置服务器

https://tensorflowcn.cn/deploy/tfserve https://tensorflow.github.io/serving/setup https://tensorflow.github.io/serving/docker

我这里有一个预构建的 Docker 容器可用

docker pull mountaintom/tensorflow-serving-inception-docker-swarm-demo

此容器已加载并准备好了 Inception 模型。

启动此容器并在其中运行以下命令以运行服务器

$ cd /serving
$ bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server --port=9000 --model_name=inception --model_base_path=inception-export &> inception_log &

有关设置服务器的更长的文章在这里

https://www.tomstall.com/content/create-a-globally-distributed-tensorflow-serving-cluster-with-nearly-no-pain/

注意

我计划对这个项目添加一些优化,因为它们已经得到了适当的测试。如果您的 Protocol Buffers 版本与我使用的版本不匹配,可能需要重新编译 protobuf 文件。一旦测试通过,我将尽快恢复自动 proto 文件编译。

在此期间,可以按照以下方式编译 proto 文件

从 Example 目录

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 -;

作者

汤姆·斯托尔,<mtm<@>mountaintom<.>com>

许可证

TensorFlowServing-InceptionClient 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。