cactuscommunications / parsey_mcparseface_export

Code for exporting syntaxnet/parsey_mcparseface as a Tensorflow SavedModelBundle
Apache License 2.0
1 stars 2 forks source link

How to install this package parsey_mcparseface_export? #1

Open thai2019 opened 5 years ago

thai2019 commented 5 years ago

Hi unsiloai,

I want to install this package. Do you have a procedure I can follow?

Thanks, Thai

thai2019 commented 5 years ago

Hi unsiloai,

This is a little background information so that you know what I have done so far. I have a docker image that has the syntaxnet installed using code downloaded from https://github.com/tensorflow/models/tree/master/research/syntaxnet. I have done some small modification to the syntaxnet tensorflow graph and now I want to export this modified syntaxnet graph by using the code you developed here. I wonder if I could simply copy some of the code you developed here for exporting the graph to protobuf, or I should reinstall the whole package you provided here. If I should reinstall the whole package, may I get a procedure from you?

Thank you in advance.

Tai

marhlder commented 5 years ago

Hi Thai, did you have a look at export_model.sh? We are no longer actively working on this repository, but I am happy to help as much as i can :) You can find export_model.sh in the documents-from-tensor branch: parsey_mcparseface_export/syntaxnet/syntaxnet/export_model.sh

Our use case was to get the pretrained parseymcparseface to work in our java pipeline (using the code/ op library found in https://github.com/unsiloai/syntaxnet-ops-hack/tree/separate_lib) and the code found here.

Please let me know if you need further assistance :)

thai2019 commented 5 years ago

Hi marhlder,

Thank you very much for responding to my questions. I performed the below mentioned steps to build the code in your repo, and run export_model.sh

Build and install tensorflow package from the source code present in your repo bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package ./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg sudo pip install /tmp/tensorflow_pkg/tensorflow-1.3.0rc2-cp27-cp27m-macosx_10_13_intel.whl

Build syntaxnet from the source code present in your repo bazel test --linkopt=-headerpad_max_install_names dragnn/... syntaxnet/... util/utf8/...

Run export_model.sh

I am getting this error after I run export_model.sh - "Op type not registered 'FeatureSize'".

Do you know what I should do to fix this problem?

Thanks, Thai

marhlder commented 5 years ago

Are you seeing the "Op type not registered 'FeatureSize'" error during the export or after trying to use the exported model?

Did you checkout the correct branch before running "export_model.sh" or did you just copy "export_model.sh"? The documents-from-tensor branch includes a modified version of parsey_mcparseface.py that should only export the model and not attempt to run inference if you give it the "export_path" parameter as done in "export_model.sh".

The problem you are seeing with "Op type not registered 'FeatureSize'" is caused by the fact that syntaxnet uses a set of its own custom ops, but that should not prevent you from exporting the model.

When trying to use the exported model you should load the custom ops as build using the code in: https://github.com/unsiloai/syntaxnet-ops-hack/tree/separate_lib

thai2019 commented 5 years ago

I am seeing "Op type not registered 'FeatureSize'" error during the export.

Yes, I have checked out the documents-from-tensor branch, built the code in that branch and running the export_model.sh from there.

Do the steps provided by me to build the code look alright to you? Or, were you using some other steps? If yes, it will be very helpful to know them. Thank you.

marhlder commented 5 years ago

Try to uninstall any tensorflow installation that you have, rebuild the project with bazel 0.8.0 and then run the export_model.sh script again. And by rebuilding i mean rebuild syntaxnet not the TensorFlow submodule. I seem to remember something about it using its own version of tensorflow as a submodule. Try to not have any Tensorflow pip package/wheel installed.

EDIT: I think i originally did it with bazel 0.5.4. or something 😕