Giter VIP home page Giter VIP logo

Comments (4)

statguy avatar statguy commented on June 27, 2024 2

I didn't give specific names for the input variables in the prediction graph so the names are default what TF gives and are different from what the save_model function specifies. Please look at predict_example.py how to obtain the input variables.

from thai-word-segmentation.

Ekkalak-T avatar Ekkalak-T commented on June 27, 2024

@statguy Thank you so much for replying.

Did you mean these input variables?

g_inputs = 'IteratorGetNext:1' g_lengths = 'IteratorGetNext:0' g_training = 'Placeholder_1:0' g_outputs = 'boolean_mask_1/Gather:0'

Unfortunately, I have tried them but also got an error related to tensor alias.
grpc.framework.interfaces.face.face.AbortionError: AbortionError(code=StatusCode.INVALID_ARGUMENT, details="input tensor alias not found in signature: IteratorGetNext:0. Inputs expected to be in the set {lengths, inputs, training}.")

client.py

text = "ทดสอบ"
inputs = [ThaiWordSegmentLabeller.get_input_labels(text)]
lengths = [len(text)]
request.model_spec.name = 'word'
request.model_spec.signature_name = 'word_segmentation'

g_inputs = 'IteratorGetNext:1'
g_lengths = 'IteratorGetNext:0'
g_training = 'Placeholder_1:0'
g_outputs = 'boolean_mask_1/Gather:0'

request.inputs[g_inputs].CopyFrom(
tf.contrib.util.make_tensor_proto(inputs,shape=[inputs.shape[0]],dtype=tf.int64))
request.inputs[g_lengths].CopyFrom(
tf.contrib.util.make_tensor_proto(lengths,dtype=tf.int64))
request.inputs[g_training].CopyFrom(
tf.contrib.util.make_tensor_proto(False,dtype=tf.bool))

from thai-word-segmentation.

statguy avatar statguy commented on June 27, 2024

I updated predict_example.py to use the signature names. Does it help?

from thai-word-segmentation.

Ekkalak-T avatar Ekkalak-T commented on June 27, 2024

@statguy Thank you so much for fixing the issue and I would like to thank again for contributing such an amazing application.

This model works perfectly with my training data. I am going to write an article about how I apply it in my domain and I will refer to your article and Github.

from thai-word-segmentation.

Related Issues (11)

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.