Giter Club home page Giter Club logo

Comments (9)

kirilg avatar kirilg commented on May 23, 2024 1

Yes. You can use a Predict SignatureDef with the Predict API. See https://github.com/tensorflow/serving/blob/master/tensorflow_serving/g3doc/signature_defs.md for more details.

from serving.

viksit avatar viksit commented on May 23, 2024

Secondly.

When exporter.init() is run with sess.graph.as_graph_def() and signature as params - is the model now only capable of being invoked using this signature?

For instance, what if my model can take multiple inputs, and I export it via Serving - am I now constrained by what the classification_signature can take?

from serving.

nfiedel avatar nfiedel commented on May 23, 2024

Hi viksit@,
Think of the signatures as annotations on the graph used for serving. They don't modify or constrain the graph in any way, so you can use it however you like. Although there is only one default signature, you can also have arbitrarily many named signatures. This can help if, for example, you want to experiment by taking outputs from different layers of a graph, but keep your code that runs inference the same.

For concatenating tensors, I think you would need to create a tensor in the graph that does the concatenation, and then reference that new single tensor, to get the behavior (I think) you are looking for in the first question.

Hope this helps. Thanks!
Noah

from serving.

viksit avatar viksit commented on May 23, 2024

Thanks, @nfiedel. Makes sense.

But to reiterate - there's no way to actually change the signature to use two or more input tensors right now (not output)? Given everything is around "Classification"?

from serving.

nfiedel avatar nfiedel commented on May 23, 2024

Hi viksit@,
That's right (for now). If you have different input/output patterns, you can easily use the generic_signature to capture named inputs & outputs.

from serving.

cancan101 avatar cancan101 commented on May 23, 2024

Related to the multiple input question would be how to deal with passing in an is_training value (presumably to False) in order to disable dropout, etc. When training validating, I use the feed dict to set this.

from serving.

walterwang avatar walterwang commented on May 23, 2024

is there a new solution to this problem? Generic_signature is deprecated

from serving.

walterwang avatar walterwang commented on May 23, 2024

@kirilg With the predict API, using multiple inputs does not work.
I constructed a toy example similar to this with a simple operation.. When I only have one input, things work fine, but if I construct the graph such that it accepts 2 placeholders following a concat operation, with the appropriate output. I get an error that I must feed a placeholder value.

$saved_model_cli run --dir /tmp/saved_model_dir --tag_set serve
--signature_def x1_x2_to_y --inputs x1=/tmp/my_data1.npy;x2=/tmp/my_data2.npy
--outdir /tmp/out

from serving.

kirilg avatar kirilg commented on May 23, 2024

Let's follow up on the saved_model_cli issue in the other issue you filed (#702 for posterity).

from serving.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.