Trying to use Universal Sentence Encoder Lite/2 via Tensorflow Serving
I created a SavedModel using the Universal Sentence Encoder Lite version. If I load the SavedModel using tf.saved_model.loader.load, it works perfectly fine.
However, if I try to serve the model using Tensorflow Serving, I'm getting the following error:
"error": "indices[3] = 1 is not in [0, 1)\n\t [[Node: lite_module_apply_default/Encoder_en/KonaTransformer/ClipToMaxLength/GatherV2_1 = GatherV2[Taxis=DT_INT32, Tindices=DT_INT64, Tparams=DT_INT64, _output_shapes=[[?]], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_qsph_v_0_7, lite_module_apply_default/Encoder_en/KonaTransformer/ClipToMaxLength/Reshape, lite_module_apply_default_1/Encoder_en/KonaTransformer/SequenceMask/Const)]]"
Any reasons on why that would be occurring?
tensorflow version: 1.9.0 tensorflow_hub version: 0.1.1 Using latest tensorflow/serving docker
I am getting the exact same error message and can‘t find any help regarding this. Is there any fix or workaround yet? I tried to serve the model using Google AI Platform.
Hi LukasHaas,
You might be using the RESTful Predict API and giving the input tensors in row format. Have you tried specifying the input tensors in columnar format? A more detailed reference can be found here
Thank you so much for the quick response. While a columnar format was unfortunately not accepted by my API, I was able to reformat my input data using the row format according to your reference. Thanks :)
Glad to help!