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)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM