This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from grpc.beta import implementations | |
import tensorflow as tf | |
from tensorflow_serving.apis import predict_pb2 | |
from tensorflow_serving.apis import prediction_service_pb2 | |
from PIL import Image | |
import numpy as np | |
tf.app.flags.DEFINE_string('server', 'localhost:9000', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras import backend as K | |
from keras.models import load_model | |
from tensorflow.python.saved_model import builder as saved_model_builder | |
from tensorflow.python.saved_model.signature_def_utils import predict_signature_def | |
from tensorflow.python.saved_model import tag_constants | |
# Function to export Keras model to Protocol Buffer format | |
# Inputs: | |
# path_to_h5: Path to Keras h5 model | |
# export_path: Path to store Protocol Buffer model |