python - 使用 Tensorflow 服务的双向流

标签 python tensorflow grpc tensorflow-serving google-cloud-speech

我有一个模型可以接受任意长度的数据流并执行分类。我使用 Tensorflow Serving 来监听 gRPC 请求并对经过训练的模型执行分类。

Google Cloud Speech API 具有 "Streaming Speech Recognition"功能,在使用 gRPC 请求时可用,它“允许您将音频流式传输到 Cloud Speech API,并在处理音频时实时接收语音识别结果流”。

我相信这是可能的,因为 gRPC documentation 中描述了双向流式 RPC由此“服务器和客户端可以“乒乓”:服务器收到请求,然后发回响应,然后客户端根据响应发送另一个请求,依此类推”。

所以现在我想知道是否可以使用 Tensorflow Serving 实现类似于 Google Cloud Speech API 流识别的功能。我在 TF Serving 的官方文档中找到的唯一引用资料(除非我遗漏了什么)是在 describing possible future improvements 的时候。 :“可服务对象可以是任何类型和接口(interface),从而实现灵 active 和 future 的改进,例如:流式传输结果 [...]”。

是否已经可以使用 TF 服务实现此功能(双向流)?如果是这样,如何?如果没有,扩展 TF 服务以添加此功能的最佳方法是什么?

最佳答案

看来这实际上目前不可用。我已经提交了 feature request在 TensorFlow Serving GitHub 存储库上被拒绝,响应如下:

TF-Serving does not support this use-case out of the box at this time, but as you allude to it would be possible to leverage its extensiblity to do so without doing major surgery on the internals. We do not currently have any short-term plans to add it to the official distribution.

他们也不愿意给出任何指导:

Unfortunately this falls outside the scope of what we can support at this time, so you'll have to devise a solution and keep it in your own repo.

关于python - 使用 Tensorflow 服务的双向流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48148109/

相关文章:

c# - 将 Postman 与 gRPC 结合使用

Python 和 .exe 文件,另一种方式

python - 使用上下文管理器控制流程

python - tensorflow 中的数据标准化

python - 将 2D numpy 数组转换为 Tensorflow 数据集

go - 未实现的 desc = 未知服务 protos.ChaincodeSupport

python - 使用多处理池加速python中的TFLite推理

python - map 等价于列表理解

python - 凯拉斯 - ValueError : The first layer in a Sequential model must get an `input_shape` or `batch_input_shape` argument

node.js - 服务器更改时如何更新客户端的 protobuf 文件