参考 文章 https://blog.csdn.net/shin627077/article/details/78592729 调试TFServing模型预测
grpc模型测试 调用相关函数过期
调用过程中报错
DeprecationWarning: beta_create_PredictionService_stub() method is deprecated. This method will be removed in near future versions of TF Serving. Please switch to GA gRPC API in prediction_service_pb2_grpc.
解决
import grpc
from tensorflow_serving.apis import predict_pb2
from tensorflow_serving.apis import prediction_service_pb2_grpc
后将
stub = prediction_service_pb2.beta_create_PredictionService_stub(channel)
改为
stub = prediction_service_pb2_grpc.PredictionServiceStub(channel)