sam
sam

Reputation: 51

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 why that would be occurring?

python version: 3.6

tensorflow version: 1.9.0

tensorflow_hub version: 0.1.1

Using tensorflow/serving docker 1.11

Upvotes: 3

Views: 360

Answers (1)

sam
sam

Reputation: 51

I was giving the input tensors in row format. By changing the format of the input tensors to columnar format, I was able to rectify the issue. A detailed description of row and columnar formats can be found here.

Upvotes: 2

Related Questions