python通过grpc调用tfserving报错has no attribute 'beta_create_PredictionService_stub'

问题背景:python通过grpc调用tfserving报错,
提示:AttributeError: module 'tensorflow_serving.apis.prediction_service_pb2' has no attribute 'beta_create_PredictionService_stub'

原因:旧版api删除了,改用新版

from tensorflow_serving.apis import prediction_service_pb2_grpc

channel = implementations.insecure_channel('localhost', 8500)
stub = prediction_service_pb2_grpc.PredictionServiceStub(channel)
posted @ 2020-07-09 11:29  致林  阅读(1028)  评论(0编辑  收藏  举报