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