最近在学习tensorflow serving,但是运行官网例子,不使用bazel时,发现运行mnist_client.py的时候出错,

在api文件中也没找到predict_pb2,因此,后面在网上看到,它在这里

"bazel-bin/tensorflow_serving/example/mnist_client.runfiles/tf_serving/tensorflow_serving/apis"

好像这是bazel编译生成的(网上观点,出处找不到啦),好吧,又回到bazel了。

 

参考:

 https://groups.google.com/a/tensorflow.org/forum/#!topic/discuss/K_k7JcUi8uw
 
 
其实从文件名pb就可以知道,是从protocol Buffer 的proto文件生成而来,可以使用:
#From tensorflow/models/
protoc object_detection/protos/*.proto --python_out=.