c# - tensorflow 服务

标签 c# python client grpc tensorflow-serving

有人知道如何创建用于 tensorflow 服务的 C# 客户端吗?

我的tensorflow服务安装:

我使用 tensorflow 服务 dockerfile 安装了 tensorflow 服务,然后在容器内执行了以下操作:

pip install tensorflow

pip install tensorflow-serving-api

echo "deb [arch=amd64] http://storage.googleapis.com/tensorflow-serving-apt stable tensorflow-model-server tensorflow-model-server-universal" | tee /etc/apt/sources.list.d/tensorflow-serving.list

curl https://storage.googleapis.com/tensorflow-serving-apt/tensorflow-serving.release.pub.gpg | apt-key add -
apt-get update && apt-get install tensorflow-model-server

然后我运行 tensorflow 服务服务器:

tensorflow_model_server --port=9000 --model_name=example_model --model_base_path=/serving/my_model_2 &> my_log &

其中 my_model_2 包含我想要服务的导出的 tensorflow 模型。

鉴于此信息,我有以下问题:

  • 我是否需要以不同的方式安装tensorflow services才能创建C#客户端?如果我需要以不同的方式安装它;你能告诉我怎么做吗?
  • 您能否让我大致了解一下我必须做什么才能实现我的目标?我的意思是,我怀疑我必须以不同的方式安装 tf 服务才能创建显式 .proto 文件。如果您能给我一个总体思路和一个例子,我对此有点迷失,我将不胜感激。

最佳答案

据我了解,您需要 proto 文件才能用 C# 为 grpc 服务生成 tensorflow 服务客户端。

https://github.com/Wertugo/TensorFlowServingCSharpClient 这是我正在遵循的一个例子。它与 C# 客户端的 MNIST 示例相同。

希望这有帮助。

如果您有更好的选择,请在此处更新。

关于c# - tensorflow 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49040715/

相关文章:

plugins - 有没有可用的安全 websocket(wss 协议(protocol))客户端浏览器插件?

python - 等待输入时如何打印?

c# - MVC 模型属性

c# - 尝试将对象转换为 javascript []{}- C# 键值集合或字典<string,object> 或<string, string>

C# - 正则表达式不匹配输入字符串

python - 在另一个程序/脚本中实时使用 Sysinternals Process Monitor 的输出

python - 根据另一列将 pandas 列重新组合为 2D 列表

python - 根据 pandas 索引范围合并行

java - HTTP URL 连接中出现错误

c# - Javascript 确认 if..else.. 条件