我正在关注使用 TensorFlow Serving 和 Kubernetes 服务 Inception 模型 https://tensorflow.github.io/serving/serving_inception.html当我尝试从本地主机进行推理时,工作流程和一切都运行良好,直到通过 k8s 提供初始模型的最终服务。
我正在运行 Pod 并输出$kubectl describe service
inception-service 与中的工作流程建议的一致使用 TensorFlow Serving 和 Kubernetes 服务 Inception 模型 https://tensorflow.github.io/serving/serving_inception.html.
然而,当运行推理时,事情就不起作用了。这是跟踪:
$bazel-bin/tensorflow_serving/example/inception_client --server=104.155.175.138:9000 --image=cat.jpg
Traceback (most recent call last):
File "/home/dimlyus/serving/bazel-
bin/tensorflow_serving/example/inception_client.runfi
les/tf_serving/tensorflow_serving/example/inception_client.py", line 56, in
tf.app.run()
File "/home/dimlyus/serving/bazel-
bin/tensorflow_serving/example/inception_client.runfi
les/org_tensorflow/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/home/dimlyus/serving/bazel-
bin/tensorflow_serving/example/inception_client.runfi
les/tf_serving/tensorflow_serving/example/inception_client.py", line 51, in
main
result = stub.Predict(request, 60.0) # 10 secs timeout
File "/usr/local/lib/python2.7/dist-
packages/grpc/beta/_client_adaptations.py", line 32
4, in call
self._request_serializer, self._response_deserializer)
File "/usr/local/lib/python2.7/dist-
packages/grpc/beta/_client_adaptations.py", line 21
0, in _blocking_unary_unary
raise _abortion_error(rpc_error_call)
grpc.framework.interfaces.face.face.AbortionError:
AbortionError(code=StatusCode.UNAVAILABLE, details="Connect Failed")
我在 Google Cloud 上运行所有内容。设置是从 GCE 实例完成的,k8s 在 Google 容器引擎内部运行。 k8s 的设置遵循上面链接的工作流程中的说明并使用inception_k8s.yaml https://github.com/tensorflow/serving/tree/master/tensorflow_serving/example/inception_k8s.yaml file.
服务设置如下:
apiVersion: v1
kind: Service
metadata:
labels:
run: inception-service
name: inception-service
spec:
ports:
- port: 9000
targetPort: 9000
selector:
run: inception-service
type: LoadBalancer
任何有关如何解决此问题的建议将不胜感激!