在其他语言环境中使用来自 TensorFlow 的深度学习模型

Using deep learning models from TensorFlow in other language environments

我有相当多的 TensorFlow 经验,我即将开始一个项目,最终将在 C# 生产环境中使用经过 TensorFlow 训练的模型。本质上,我将拥有将进入 C# 环境的实时数据,我最终需要根据我在 TensorFlow 中的模型输出做出决策/采取某些行动。这基本上只是现有基础设施的限制。

我能想到几个可能不好的实现方法,例如将数据写入磁盘然后调用应用程序的 Python 部分,最后读取 Python 应用程序并根据它采取一些行动。但是,这很慢。

是否有更快的方法来实现 C# 和基于 Python 的 Tensorflow 之间的相同集成关系。我看到 there appear to be some ways 可以用 C++ 和 TensorFlow 做到这一点,但是 C# 呢?

这是 TensorFlow Serving, which lets you create a C++ process that can run inference on a trained TensorFlow model, and serves inference requests over gRPC. You can write client code in any language that gRPC supports. Take a look at the MNIST tutorial: C++ server and Python client 个组件的主要用例。