Tensorflow 服务 - 状态 LSTM

Tensorflow Serving - Stateful LSTM

是否有规范的方法来使用 Tensorflow Serving 维护有状态的 LSTM 等?

直接使用 Tensorflow API 这很简单 - 但我不确定在将模型导出到 Serving 后如何最好地在调用之间完成持久化 LSTM 状态。

有没有实现上述功能的示例?回购中的样本非常基础。

来自 TF 邮件列表上的 Martin Wicke:

"There's no good integration for stateful models in the model server yet. As you noted, it basically assumes models are pure functions. We're working on this, and you should see this functionality appear eventually, but it's too far out to promise a time. So in the meantime, you can write a simple wrapper which keeps state on the server (and assigns some sort of session ID which is passed around in requests), or you can write your own server which maintains the TensorFlow session state (and similarly returns some session ID). The latter is more performant. Both will require some sort of garbage collection/session timeout logic."