gpt4 book ai didi

python - 不同类型的 TensorFlow SignatureDef 的目的是什么?

转载 作者:太空宇宙 更新时间:2023-11-04 04:25:24 24 4
gpt4 key购买 nike

Predict SignatureDef 似乎包含了 Classification and Regression SignatureDef 的所有功能。什么时候使用 Classification 或 Regression SignatureDefs 而不是仅对所有内容使用 Predict 会有优势?我们希望降低生产环境的复杂性,如果可以在所有情况下仅使用 Predict SignatureDefs,那似乎是个好主意。

最佳答案

从我在文档 (https://www.tensorflow.org/serving/signature_defs) 中看到的内容来看,似乎“分类”和“回归”SigDefs 试图为简单情况(分类和回归)强制使用一个简单且一致的界面,分别是“inputs”-->“classes+scores”和“inputs”->“outputs”。 “分类”和“回归”SigDef 似乎还有一个额外的好处,即不需要将服务函数构建为模型导出函数的一部分。

另外,从文档中可以看出,Predict SigDef 似乎允许更通用的接口(interface),并具有能够换入和换出模型的好处。来自文档:

Predict SignatureDefs enable portability across models. This means that you can swap in different SavedModels, possibly with different underlying Tensor names (e.g. instead of x:0 perhaps you have a new alternate model with a Tensor z:0), while your clients can stay online continuously querying the old and new versions of this model without client-side changes.

Predict SignatureDefs also allow you to add optional additional Tensors to the outputs, that you can explicitly query. Let's say that in addition to the output key below of scores, you also wanted to fetch a pooling layer for debugging or other purposes.

但是文档没有解释,除了不必导出服务函数的次要好处外,为什么人们不对一切都使用 Predict SigDef 因为它似乎是一个有很多上升空间的超集。我很想看到一个明确的答案,因为专门功能(分类、回归)的好处似乎微乎其微。

关于python - 不同类型的 TensorFlow SignatureDef 的目的是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53602759/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com