serving: predict_pb2.py missing
Having built from src I’m trying to run the inception example. It builds. The server run shows no errors. Then when I try to run the client I get an import error as there apears to be no predict_pb2.py
prediction_service_pb2 is there however.
python inception_client.py
Traceback (most recent call last):
File "inception_client.py", line 26, in <module>
from tensorflow_serving.apis import predict_pb2
ImportError: cannot import name predict_pb2
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (5 by maintainers)
Thanks for the response! But this is a very awkward way of working. e.g. running it in pycharm debugger is a highly productive way to learn a project. The reliance on bazel compilation messes this up badly. I think bazel is an amazing build tool, but for scripting languages, it not only seems like overkill, but actually harms productivity a lot.
Sorry for the opinionated post, but I know I’m not alone, every developer i know working on TF projects via python have said similar things. is there any hope that the python will be disentangled from the bazel build process? Coupling via importable python libraries seems a simpler and more manageable interface for most people actually using the TF tools. I mean this to be constructive, not an ungrateful moan.
If you need
model_pb2.py,predict_pb2.pyorprediction_service_pb2.py, we have generated from protobuf files and you can download in deep_recommend_system.This have been discussed for long time. If you’re using
bazel, everything should work like a charm. If you’re using Python purely, we have the solution for this. Download the protobuf files from tensorflow/tensorflow and tensorflow/serving projects, use gRPC library to generate the file. You can use this script directly in https://github.com/tobegit3hub/deep_recommend_system/tree/master/python_predict_client/generate_python_files .pip install tensorflow-serving-apiThis command resolved the issue for me. Details are here.
The
pip install tensorflow-serving-apilooks like it’s just for python 2. Are there any plans to support python 3?The serving api is also available for python 3:
pip install --upgrade tensorflow-serving-api-python3