Comments (4)
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.
@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.
I updated predict_example.py to use the signature names. Does it help?
from thai-word-segmentation.
@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)
- .\checkpoints : Access is denied.
- Could you please give me some data or just a few lines of data format? HOT 1
- How the text is supposed to be normalized if I'm using the saved model?
- AttributeError: module 'tensorflow._api.v2.saved_model' has no attribute 'signature_constants'
- Duplicate writing training data in preprocessing.py? HOT 1
- Lao word segmentation Issue HOT 2
- Installing requirements HOT 2
- Sentence segmentation HOT 1
- Hello
- f1-score evaluation
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 thai-word-segmentation.