Tensorflow服务客户端不起作用

时间:2018-01-30 12:38:27

标签: tensorflow tensorflow-serving

我正在尝试根据本教程构建一个程序来预测已经训练过的模型

https://github.com/GoogleCloudPlatform/cloudml-samples/tree/master/flowers

为此,我正在使用Docker和Tensorflow服务跟进本教程:

https://towardsdatascience.com/how-to-deploy-machine-learning-models-with-tensorflow-part-2-containerize-it-db0ad7ca35a7

当我运行基于此示例的客户端时: https://github.com/tensorflow/serving/blob/master/tensorflow_serving/example/inception_client.py

我收到了这个错误:

userml@userml:~/usermodel$ python tensorflow_serving_client.py --server=172.17.0.2:9000 --image=./image5578.jpg
Traceback (most recent call last):
  File "tensorflow_serving_client.py", line 87, in <module>
    tf.app.run()
  File "/home/userml/.local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "tensorflow_serving_client.py", line 46, in main
    result = stub.Predict(request, 60.0)  # 60 secs timeout
  File "/home/userml/.local/lib/python2.7/site-packages/grpc/beta/_client_adaptations.py", line 324, in __call__
    self._request_serializer, self._response_deserializer)
  File "/home/userml/.local/lib/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.INVALID_ARGUMENT, details="input size does not match signature")

我该如何解决这个问题? 我试图找到输入大小,设置'shape [1]'但似乎不起作用。我的模型是否有与客户端不兼容的东西?

非常感谢!

0 个答案:

没有答案