Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

"Bad input. 'keyed_values' property is not specified" error when calling "score" method #34

Open
damnko opened this issue Jun 5, 2019 · 0 comments

Comments

@damnko
Copy link

damnko commented Jun 5, 2019

Hi, I have successfully deployed a model by following this tutorial: https://github.com/pmservice/wml-sample-models/blob/master/tensorflow/import/tensorflow-import-python.ipynb

My model is slightly different because instead of doing the inference with

test_results = session.run( classification, feed_dict = { X : X_test } )

I do it with

tensor_input_ids = self.graph.get_tensor_by_name('input_ids_1:0')
tensor_input_mask = self.graph.get_tensor_by_name('input_mask_1:0')
tensor_label_ids = self.graph.get_tensor_by_name('unique_ids_1:0')
tensor_segment_ids = self.graph.get_tensor_by_name('segment_ids_1:0')
tensor_outputs = [self.graph.get_tensor_by_name('unstack:0'), 
                          self.graph.get_tensor_by_name('unstack:1')]

result = self.sess.run(tensor_outputs, feed_dict={
                tensor_input_ids: np.array(input_ids).reshape(-1, self.max_seq_length).tolist(),
                tensor_input_mask: np.array(input_mask).reshape(-1, self.max_seq_length).tolist(),
                tensor_label_ids: np.array(unique_ids).tolist(),
                tensor_segment_ids: np.array(segment_ids).reshape(-1, self.max_seq_length).tolist(),
            })

so my input of the model is quite different from the one of the jupyter notebook demo.

I have tried to format my input data in different ways, and among those I also tried this mock data

payload = {
    "fields": ["unique_ids", "segment_ids", "input_mask", "input_ids"],
    "values": [['one', 'two', 'three', 'four']]
}

but when I call the function client.deployments.score( model_endpoint_url, payload ) I always get the following error

Status code: 400, body: {"trace": "25d202cc18bf01c0e3de4dc56f090168", "errors": [{"code": "invalid_input_data", "message": "Bad input. 'keyed_values' property is not specified."}], "status_code": 400}

Do you have any idea on why this is happening? I am not able to find documentation on that error anywhere.

Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant