Tensorflow Serving - Stateful LSTM

不问归期 提交于 2020-01-21 06:36:54

问题


Is there a canonical way to maintain a stateful LSTM, etc. with Tensorflow Serving?

Using the Tensorflow API directly this is straightforward - but I'm not certain how best to accomplish persisting LSTM state between calls after exporting the model to Serving.

Are there any examples out there which accomplish the above? The samples within the repo are very basic.


回答1:


From Martin Wicke on the TF mailing list:

"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."



来源:https://stackoverflow.com/questions/43710693/tensorflow-serving-stateful-lstm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!