使用 contrib 操作的 Tensorflow 服务
Tensorflow serving with contrib operations
如果有 tf.contrib 个操作,我如何使用 tensorflow-serving 服务模型。我通过 Docker(最新)(tf 1.11 版本)使用 Tensorflow Serving,当我为模型提供服务时,会出现下一条消息:
“Failed to start server. Error: Unknown: 1 servable(s) did not become available: {{{name: slider_universal version: 1} due to error: Not found: Op type not registered ‘ImageProjectiveTransformV2’ in binary running on 254345a5d9f1. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) tf.contrib.resampler should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.}, }”
我也是用bazel构建的,但是出现了同样的错误
如果我在导出模型时删除这个操作,它可以由 tensorflow serving 提供服务
我在使用相同的操作时遇到了问题,看来唯一的方法就是构建它。
tensorflow_serving/model_servers/BUILD
定义了哪些 Tensorflow ops 将包含在变量 SUPPORTED_TENSORFLOW_OPS
中,我对此有点困惑,因为它指定应包含 contrib ops。但是,由于 tensorflow contrib 构建规则似乎不包含 contrib.image
下的操作,因此我通过将此变量更新为以下
来明确添加这些操作
SUPPORTED_TENSORFLOW_OPS = [
"@org_tensorflow//tensorflow/contrib:contrib_kernels",
"@org_tensorflow//tensorflow/contrib:contrib_ops_op_lib",
"@org_tensorflow//tensorflow/contrib/image:image_ops_kernels",
"@org_tensorflow//tensorflow/contrib/image:image_ops_op_lib",
]
如果有 tf.contrib 个操作,我如何使用 tensorflow-serving 服务模型。我通过 Docker(最新)(tf 1.11 版本)使用 Tensorflow Serving,当我为模型提供服务时,会出现下一条消息:
“Failed to start server. Error: Unknown: 1 servable(s) did not become available: {{{name: slider_universal version: 1} due to error: Not found: Op type not registered ‘ImageProjectiveTransformV2’ in binary running on 254345a5d9f1. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) tf.contrib.resampler should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.}, }”
我也是用bazel构建的,但是出现了同样的错误
如果我在导出模型时删除这个操作,它可以由 tensorflow serving 提供服务
我在使用相同的操作时遇到了问题,看来唯一的方法就是构建它。
tensorflow_serving/model_servers/BUILD
定义了哪些 Tensorflow ops 将包含在变量 SUPPORTED_TENSORFLOW_OPS
中,我对此有点困惑,因为它指定应包含 contrib ops。但是,由于 tensorflow contrib 构建规则似乎不包含 contrib.image
下的操作,因此我通过将此变量更新为以下
SUPPORTED_TENSORFLOW_OPS = [
"@org_tensorflow//tensorflow/contrib:contrib_kernels",
"@org_tensorflow//tensorflow/contrib:contrib_ops_op_lib",
"@org_tensorflow//tensorflow/contrib/image:image_ops_kernels",
"@org_tensorflow//tensorflow/contrib/image:image_ops_op_lib",
]