I am using Tensorflow Object Detection API(github.com/tensorflow/models/tree/master/object_detection) with one object detection task. Right now I am having problem on serving th
Your idea is fine. It' ok to have that warning.
The issue is that the input needs to be converted to uint8
as the model expects. Here is the code snippet that worked for me.
request = predict_pb2.PredictRequest() request.model_spec.name = 'gan' request.model_spec.signature_name = signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY image = Image.open('any.jpg') image_np = load_image_into_numpy_array(image) image_np_expanded = np.expand_dims(image_np, axis=0) request.inputs['inputs'].CopyFrom( tf.contrib.util.make_tensor_proto(image_np_expanded, shape=image_np_expanded.shape, dtype='uint8'))
This part is important for you shape=image_np_expanded.shape, dtype='uint8' and make sure to pull the latest update for serving.