当前位置: 代码迷 >> 综合 >> 解决 grpc模型预测 Please switch to GA gRPC API in prediction_service_pb2_grpc.
  详细解决方案

解决 grpc模型预测 Please switch to GA gRPC API in prediction_service_pb2_grpc.

热度:77   发布时间:2023-12-19 13:37:46.0

参考 文章 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)

  相关解决方案