-
Notifications
You must be signed in to change notification settings - Fork 45.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syntaxnet: Enable building Parsey McParseface in one model to be served in TF serving #250
Conversation
This is great work, it will help me out on some projects. Congratulating and subscribing 👍 |
@dmansfield Hi, I was trying to test your fork, but getting error no such package '@protobuf//': error loading package 'external' One replacing the same with //tensorflow/google/protobuf on line 16 of syntaxnet.bzl , while this error is resolved, but then i get a similar error on Build file line 36 |
I've successfully built your code, but can't run the parsey_mcparseface.py script from bazel-bin because it cannot import tensorflow_serving. Does tensorflow_serving have to be added to the build file as a dependency?
|
@apodolny . Oops, yes. In fact I have TF serving built in a parallel directory and then I've used PYTHONPATH environment variable to pull in the python dependencies (very bad and not "bazel"-ish). That's a TODO I guess. I'm not really happy with the complex dependencies between these three TF projects (TF itself, models and serving), and spent quite a lot of time sorting it out and getting the various projects in sync in terms of git checkout level (submodules etc). I'll think a bit more about this and see if there's something better. Maybe "Parsey for export" should be a standalone project. |
@dmansfield i was able to ˀbuild parey_mcparseface and export model properly. Can you also put some light on the serving code to load the model. I am getting segmentation fault event after adding parser_ops.so to build path with backtrace |
@apodolny yes you need to include tensorflow_serving to dependencies, i did it by setting env variable PYTHONPATH to include tensorflow_serving path before running parsey_mcparseface script |
@arvindsg I'm going to create a new repository with a sample client/server that works with an exported model. Stay tuned... |
Subscribing. |
SentenceBatch accepts a vector of Sentence protos to use instead of reading from the configured corpus. When using a feed, the corpus will be ignored and only the fed sentences will be used. Supports "rewind" on the feed.
… protos to parse Add an input Tensor to BeamParseReader to provide serialised sentence protos to parse. Documents may come from the input tensor (e.g. read by a DocumentSource op) or read directly from the corpus as defined in the task context. The decision of the approach should is explicit based on attributes during graph configuration.
If constructed with a vector of strings, TextReader will use a new "RandomAccessFile" implementation, VectorIn (cloned from the StdIn implementation) to read the strings from the vector. The format of the strings is still determined by the corpus configured in the task context.
The DocumentSource requires a text input tensor to be provided, even when the text is to be read from the corpus, because tensors cannot be optional. The value of the tensor is unused.
If the document source is provided, it will be used and the parser will not read from the corpus. If it is provided, the document protos will be consumed from the provided op and the configured corpus will be ignored
This new script replaces demo.sh for running Parsey McParseface model. It takes a different approach from demo.sh which is that it builds the entire operation chain (tagging AND parsing) in a single model, complete with a document source and document sink. The script also exports the model in various ways, including using the TF Serving exporter, such that the model can be served using TF Serving
5dd60e6
to
2a7f1c3
Compare
I rebased against master to fix the conflicts, also included the exporting of the "assets" in the export. The "assets" are the files that the graph needs at runtime, which in this case is the entire models/syntaxnet/syntaxnet/models/parsey_mcparseface directory. The missing assets are probably the cause of the segfault experienced by @arvindsg (even just a symlink directly into the syntaxnet tree will fix this). I've just rebuilt everything and re-exported and tested and it works for me. Note: I'm building on-top of master of tensorflow, serving and models (models+this PR) in my environment. I've created this project: https://github.com/dmansfield/parsey-mcparseface-api Which includes a working TF Serving server and a test client (nodejs). As of now I've committed the exported model and it's in the checkout. There's still a lot to do though! Please let me know if you get any further. |
@dmansfield Thank you, I was able to get everything working after a fresh clone, segmentation fault was due to version mismatch of tensor flow when i exported and when i was trying to serve. |
Yes, I had that segfault too. On Jul 24, 2016 3:56 AM, "arvindsg" notifications@github.com wrote:
|
Is this still relevant? If so, pull rebase? |
@drpngx I will rebase. |
@dmansfield can't wait to see this merge 👍 |
Anyone updates on this? Would love to see it merged! |
To try this out, I rebased this on master, fixed a couple of conflicts and added a couple of tiny bits on top. For reference, it's here. This next bit is a bit off topic, but is the reason I found this PR: I tried to use parsey without needing all of the sources or running scripts from within the source. It's been a while since this PR was updated, but in general I'm not sure if this approach, or using Dragnn is the best way to go here? I spent some time and found it quite tricky trying to use parsey as if it was a library; for now I gave up trying to hack parsey into dragnn, even though the example code might be very close to what's needed... This PR was the best approach I actually got working without running from the source tree (thanks @dmansfield!), but it seems like it still needs a bit of work to make parsey available from other applications. |
I'm not able to get this to work. Is this still compatible with @dmansfield his parsey-mcparseface-api repository? Would this till build under the latest bazel? Or is there another way to keep the program running? |
Can one of the admins verify this patch? |
Closing very old PRs. I do not like seeing work lost. I and others are working to accept any changes to /official; but changes to other directories require the original owner to take action. I am sorry this change died/stalled. I am copy and pasting this message in each PR I a closing (yes kind of like an automated response); and I want to say I feel this way about each PR and wish they had ended with a merge or some other more positive finality. Thank you for your contribution and time. |
At a high level, this PR enables the entire Parsey McParseface model to be built in a single model, exported, and served with TF serving.
This required two main changes:
This PR has the following issues/limitations: