tensorflow / tensor2tensor

Library of deep learning models and datasets designed to make deep learning more accessible and accelerate ML research.
Apache License 2.0
15.6k stars 3.51k forks source link

How to send python list to a tensorflow serving model server #1864

Open Brucewuzhang opened 4 years ago

Brucewuzhang commented 4 years ago

Description

I implemented a custom translation decoding algorithm using transformer. But I encounter a problem when I want to export my model.

Is it possible to pass some python list to a model server (using tensorflow serving)? I noticed that the serving_input_fn only accept tensors. I want to use some extra information in a customed translation decoding. I tried to first pass as tensor then get static value. This works fine in an eager execution script. But when I tried to export my custom model, the get static value method return None. Is there any way to get around this?