0
votes

I am trying to deploy a model based on Object Detection example to do some tests and I am getting this error:

"Expects arg[0] to be uint8 but float is provided"

In that case I am using this to load my data:


request.inputs['inputs'].CopyFrom( tf.contrib.util.make_tensor_proto({FLAGS.input_image}))


where FLAGS.input_image is my image data in bytes.

I was thinking that maybe that I should convert my image bytes to something that this input understands, but I haven't found yet.

What could I do to fix this issue?

Thanks !!!!

1
uint8 is a common data format for images. Try converting your image before passing it to the request. See docs.scipy.org/doc/numpy-1.13.0/user/basics.types.htmlsdcbr

1 Answers

1
votes

To convert the image to bytes, use the following in client code (python)

with open(FLAGS.image, 'rb') as f:
     data = f.read()

Also please find a sample client (for inception model in python) as follows https://github.com/tensorflow/serving/blob/master/tensorflow_serving/example/inception_client.py