Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #26 from nareddyt/tf-serving-deprecation
Browse files Browse the repository at this point in the history
Fix deprecation warnings in tf_serving sample client
  • Loading branch information
clennan authored May 14, 2019
2 parents b4da470 + 03b28ad commit 0cd97f9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions contrib/tf_serving/tfs_sample_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import numpy as np
import tensorflow as tf
from src.utils import utils
from grpc.beta import implementations
from tensorflow_serving.apis import predict_pb2, prediction_service_pb2
import grpc
from tensorflow_serving.apis import predict_pb2, prediction_service_pb2_grpc

TFS_HOST = 'localhost'
TFS_PORT = 8500
Expand All @@ -27,8 +27,9 @@ def get_image_quality_predictions(image_path, model_name):
image = keras.applications.mobilenet.preprocess_input(image)

# Run through model
channel = implementations.insecure_channel(TFS_HOST, TFS_PORT)
stub = prediction_service_pb2.beta_create_PredictionService_stub(channel)
target = f'{TFS_HOST}:{TFS_PORT}'
channel = grpc.insecure_channel(target)
stub = prediction_service_pb2_grpc.PredictionServiceStub(channel)
request = predict_pb2.PredictRequest()
request.model_spec.name = model_name
request.model_spec.signature_name = 'image_quality'
Expand Down

0 comments on commit 0cd97f9

Please sign in to comment.