tensorflow_template_application icon indicating copy to clipboard operation
tensorflow_template_application copied to clipboard

python predict client problem

Open sailor88128 opened this issue 8 years ago • 5 comments

Hi tobe, I want to use the python and java client to get data back from tf serving server on another PC 10.10.10.229. It seems bazel and tensorflow is not necessary here. But when I run the predict_client.py code, it seems the connection failed. How can I fix?

~/Desktop/tensorflow_template_application/python_predict_client$ ./predict_client.py --host 10.10.10.229 --port 9000 --model_name dense --model_version 1
Traceback (most recent call last):
  File "./predict_client.py", line 51, in <module>
    main()
  File "./predict_client.py", line 46, in main
    result = stub.Predict(request, request_timeout)
  File "/usr/local/lib/python2.7/dist-packages/grpc/beta/_client_adaptations.py", line 309, in __call__
    self._request_serializer, self._response_deserializer)
  File "/usr/local/lib/python2.7/dist-packages/grpc/beta/_client_adaptations.py", line 195, in _blocking_unary_unary
    raise _abortion_error(rpc_error_call)
grpc.framework.interfaces.face.face.AbortionError: AbortionError(code=StatusCode.UNAVAILABLE, details="Connect Failed")

sailor88128 avatar Nov 22 '17 07:11 sailor88128

It seems that you have not find the file. The files are in https://github.com/tobegit3hub/tensorflow_template_application/tree/master/python_predict_client/generate_python_files .

tobegit3hub avatar Nov 22 '17 13:11 tobegit3hub

The path of proto files should be set up in predict_client.py ?

sailor88128 avatar Nov 23 '17 01:11 sailor88128

Have you changed the error message of this problem? @sailor88128

Now it seems that the python client works but the server has not started. So you get the StatusCode.UNAVAILABLE problem. You need to setup your tensorflow serving server in 10.10.10.229:9000 before starting the client.

tobegit3hub avatar Nov 24 '17 04:11 tobegit3hub

Oh, it seems you are right. The serving code is running in docker, the docker port 9000 is linked with host PC port 9000. Then I want to visit serving from another PC. Maybe I need to start the serving on host PC port 9000?
It seems not a direct way... What's the usual way to provide serving?

sailor88128 avatar Nov 28 '17 09:11 sailor88128

No, I did not change the error message. @tobegit3hub

sailor88128 avatar Nov 28 '17 09:11 sailor88128