Exporting LTR Model in SavedModel Format
See original GitHub issueCould we please get an example of how to save the produced model in https://github.com/tensorflow/ranking/blob/master/tensorflow_ranking/examples/tf_ranking_libsvm.ipynb in SavedModel format (ref: https://www.tensorflow.org/guide/saved_model). I’ve tried a bunch of variations of exporting from the TensorFlow API docs and GitHub examples with no luck.
feature_columns = example_feature_columns()
feature_spec = tf.feature_column.make_parse_example_spec(feature_columns)
export_fn = tf.estimator.export.build_parsing_serving_input_receiver_fn(feature_spec)
ranker.export_savedmodel("savedmodel", export_fn)
With the example above I get KeyError: NumericColumn(key='1', shape=(1,), default_value=(0.0,), dtype=tf.float32, normalizer_fn=None)
Some guidance on this problem would be greatly appreciated.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Using the SavedModel format | TensorFlow Core
For a quick introduction, this section exports a pre-trained Keras model and serves image classification requests with it. The rest of the guide...
Read more >Using Saved Model Format from Tensorflow Lite Model Maker ...
Following this tutorial I created an simple model for image classification with Tensorflow Model Maker. I changed export format from tflite ...
Read more >Export TensorFlow models in the SavedModel format
This topic describes how to export TensorFlow models in the SavedModel format. SavedModel format. Before you use the built-in official processor ...
Read more >Exporting a SavedModel for prediction | AI Platform Prediction
To deploy your trained models to AI Platform Prediction and use them to serve predictions, you must first export them in the TensorFlow...
Read more >Save, Load and Export Models with Keras - Coursera
We can also export the models to TensorFlow's Saved Mode format which is very useful when serving a model in production, and we...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@hodeld This might help you:
can you share an example of how this works with
build_raw_serving_input_receiver_fn? The purpose here is to interface with requests that feed features directly instead of through a tf.Example.gives the error:
ValueError: slice index 1 of dimension 0 out of bounds. for 'groupwise_dnn_v2/infer_sizes/strided_slice_1' (op: 'StridedSlice') with input shapes: [1], [1], [1], [1] and with computed input tensors: input[1] = <1>, input[2] = <2>, input[3] = <1>.