Skip to main content
 首页 » 编程设计

python之tensorflow 服务是否适用于多个输入(或输出)

2024年09月07日28dudu

根据:https://blog.keras.io/keras-as-a-simplified-interface-to-tensorflow-tutorial.html#exporting-a-model-with-tensorflow-serving

Any Keras model can be exported with TensorFlow-serving (as long as it only has one input and one output, which is a limitation of TF-serving)

这(仍然)是真的吗?我找不到其他引用资料

请您参考如下方法:

只要使用 TF-serving 的 PREDICT 接口(interface),您就可以拥有多个输入和输出张量,并在 SavedModel 的不同签名中公开它们的任意组合。例如,看

https://www.tensorflow.org/serving/signature_defs

因此,尽管 Keras-exporter 代码中可能存在限制(我没看过),但 TensorFlow Serving 上的 SavedModel 中没有此类限制(我正在开发的产品经常使用该功能)