Comments (10)
Hi @mironnn,
The tf.Example data structure is not intuitive. The data structure needs to be serialized and then encoded as base64
strings. I have created this Github gist with the example code (no error handling).
Let me know if you have any questions regarding the example. It works with the output of the latest BERT pipeline version and required a recent version of TF Serving.
from workshops.
In the coming days, I will publish a pipeline which doesn't require the tf.Example
data structure.
from workshops.
@hanneshapke Thanks for the offer! I think the best place to document this would be in https://github.com/tensorflow/tfx/blob/master/docs/guide/keras.md
I would also be interested to include your Colab, probably under https://github.com/tensorflow/tfx/tree/master/docs/tutorials/serving
from workshops.
@hanneshapke maybe you can help me?
I would really appreciate it
from workshops.
@hanneshapke Thank you so much for your time and for the provided example.
Yeah, it would be great! It is very interesting to see how to make requests without preparation (serialization in the client) directly to the TF Serving with raw text.
from workshops.
Hi @mironnn,
Here is the example of the model export without the tf.Example requirement. Please note that if your model has multiple inputs, the TensorSpecs in the concrete_function() need to be adjusted. Those inputs also need to be consumed in serve_tf_examples_fn
. I have added the REST request example without the tf.Example requirement to the end of the notebook.
Colab version of the BERT Pipeline which exports a model for simple REST requests:
https://colab.research.google.com/gist/hanneshapke/f0980b7422d367808dae409536fe9b46/tfx_pipeline_for_bert_preprocessing_wo_tf-example.ipynb
@rcrowe-google I think the TFX docs should mention the export of Keras models without the tf.Example dependency. I am happy to update the existing TFX documentation. Do you mind pointing me in the right direction where additional comments would be most appropriate?
@mironnn Let me know if you have any questions. I think we can close this issue.
from workshops.
@joeliedtke for reference
from workshops.
@rcrowe-google Thank you for your reply. I'll make those PRs tomorrow.
It seems to be timely. Someone else raised the question in tensorflow/tfx#1885
I will ping you and @joeliedtke when the PRs are ready for a review.
from workshops.
+1 to @hanneshapke
May we revise the demonstration of serving_input_fn() for model export to not receive 1-D Bytes Tensors and do parse_examples() in the serving graph, but simply receive flat list of raw Tensors? It's fine to receive serialized tf.Examples as input in training input_fn, but this characteristics doesn't have to carry over to serving_input_fn(), and doing so with Keras model is causing non-intuitive behavior like this issue and tensorflow/tfx#1885.
from workshops.
The tf.Example data structure is not intuitive. The data structure needs to be serialized and then encoded as
base64
strings. I have created this Github gist with the example code (no error handling).
@hanneshapke is there an example for gRPC? I have b64 encoded data but can't find the right format to make the prediction over the protocol.
from workshops.
Related Issues (13)
- use lstm
- Notebooks in README moved HOT 2
- Real Time Forecasting/Prediction Not getting feasible
- workshops/extras/archive/05_custom_estimators.ipynb wont render HOT 1
- movie-classification won't work on TF 1.13 or above HOT 1
- Workshops fail with "This file has moved" HOT 2
- Not authorized to get pickles HOT 5
- Worshop "File has moved"
- https://storage.googleapis.com/tensorflow-workshop-examples/stack-overflow-data.csv missing HOT 4
- TFX Evaluator takes too long in "TFX_Pipeline_for_Bert_Preprocessing" HOT 4
- Dataflow fails on Transform component in "TFX_Pipeline_for_Bert_Preprocessing" HOT 2
- very confused with tensorflow java api HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from workshops.