grpc.framework.interfaces.face.face.AbortionError: AbortionError(code=StatusCode.UNAVAILABLE, detail

安装完tensorflow serving后,总是要试验一下是否安装的正确。就拿inception 模型为例测试一下tensorflow serving是否安装的正确吧。

tensorflow serving 加载inception模型后,就需要执行编译后的inception_client了:

发现如下错误:

$ ./inception_client --server=localhost:9000 --image=/tmp/dog.jpg
Traceback (most recent call last):
  File "/home/dingqs/.cache/bazel/_bazel_dingqs/0130d3df8ec98e0b1780861ce4995117/execroot/serving/bazel-out/local-fastbuild/bin/tensorflow_serving/example/inception_client.runfiles/tf_serving/tensorflow_serving/example/inception_client.py", line 56, in
    tf.app.run()
  File "/home/dingqs/.cache/bazel/_bazel_dingqs/0130d3df8ec98e0b1780861ce4995117/execroot/serving/bazel-out/local-fastbuild/bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/home/dingqs/.cache/bazel/_bazel_dingqs/0130d3df8ec98e0b1780861ce4995117/execroot/serving/bazel-out/local-fastbuild/bin/tensorflow_serving/example/inception_client.runfiles/tf_serving/tensorflow_serving/example/inception_client.py", line 51, in main
    result = stub.Predict(request, 10.0)  # 10 secs timeout
  File "/usr/lib64/python2.7/site-packages/grpc/beta/_client_adaptations.py", line 324, in __call__
    self._request_serializer, self._response_deserializer)
  File "/usr/lib64/python2.7/site-packages/grpc/beta/_client_adaptations.py", line 210, in _blocking_unary_unary
    raise _abortion_error(rpc_error_call)
grpc.framework.interfaces.face.face.AbortionError: AbortionError(code=StatusCode.UNAVAILABLE, details="Endpoint read failed")


在百度上搜索了很长时间都没有搞定这个问题,还是google靠谱,在google上一下就找到解决方法了:

上面报错是由于在当前环境中有proxy相关的环境变量,比如http_proxy,https_proxy,ftp_proxy等。。。只需要取消(unset)这些环境变量就可以了。

可以通过命令 :env | grep proxy 查看当前用户环境是否有proxy相关的环境变量。

若有,取消这些proxy相关的环境变量即可。


搞定!!!


你可能感兴趣的:(Linux,tensorflow,serving)