-
Notifications
You must be signed in to change notification settings - Fork 346
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
Error loading '_text_similarity_metric_ops.so' when running unit tests #160
Comments
Yes; this is an open issue we are looking at. TF updated their build environment to Ubuntu 16, and we have only recently got our builds migrated over. Unfortunately, we haven't gotten the tests moved over yet, but this is a high priority for us. |
Are there any possible work arounds to be able to utilize the tests? Was thinking of trying to work on an open issue / feature request around the sliding window but having trouble starting since I want to use the current unit tests to help me workout the logic. |
I think the tests are in a better state now in the master branch, and should be working. |
Hmm I just tried to run the tests locally but still get the same issue. I must have something weird in my setup I need to figure out. |
I wanted to double-check this worked before closing, and discovered the problem y'all have been experiencing. The custom op unit tests are building the shared libraries to test against. However, most likely the environment is not the same, which creates problems in linking. Our automated tests don't have this same issue since they are being built in the correct environment. The other option (apart from matching build environments) would be to rebuild TensorFlow, then run the unit tests against that, which is a poor solution. I don't have a good answer to this at the moment, so we'll need to give this more thought on how we wish to handle it. Note that this is only a problem with running the tests on Linux. MacOS has less build environment varieties for the most part. |
@hanneshapke No I kept running into the issue locally on my mac. I sort of gave up for a while. Been meaning to try to look into it again. |
The solution here is to provide a docker image to run the tests in. This would be similar to what is described in https://github.com/tensorflow/custom-op Since the automated tests are working though, this is just lower priority at the moment compared to releasing a Keras version of the BERT model, releasing more text models, expanding ragged tensor support, etc. |
ah thats a good idea actually. |
The error seems to be reoccurring in TF Nightly but is not present in 2.2.0 |
I have the same issue. I've installed tf-nightly, but now I can not import tensorflow_text because of it:
See this colab: Can you please help me |
Hi @evyasonov , I just looked at your notebook. The version of I tried the import statement in your notebook with the latest stable TF release, and the import of tf-text work.
Do you need to nightly version of tf? |
@hanneshapke |
Unfortunately, we do not have nightly releases for TF Text at this time. If you actually must use tf-nightly and the latest TF Text release is incompatible, you will need to build the pip package from source (https://github.com/tensorflow/text#build-from-source-steps). There are a couple things to keep in mind if you build TF Text from source. First, make sure to update the WORKSPACE file with the nightly version of TF that you will be running (and have that version installed). Also, note that the package you build is only guaranteed to be compatible for the system you build it on. If you want to distribute it to other machines, you need to build it in the docker image provided by TF. |
@broken Is it correct that I should update this part with tf-nightly version:
? If so, what prefix and what url should I use? I have 2.4.0-dev20200908 installed and I tried to use this url " https://github.com/tensorflow/tensorflow/archive/v2.4.0-dev20200908.zip ", bit it failed. Can you help please |
That's the right place to update. Unfortunately, TF does not add tags to its nightly builds, so you cannot download the code directly like that. What you need to do is determine the SHA of the commit from the nightly you have. Once you have the nightly version installed, you can find the SHA with
This is only the first 10 characters of the full SHA though. You can probably get the full commit using Once you have the full SHA, you can then use it in the URL of the WORKSPACE file. You can delete the sha256 verification, or use sha256sum on the downloaded zip to determine and update it. The prefix is the name of the directory when you unzip that file. In this case, it should be: |
@broken I've finally builded tensorflow-nightly from source:
I've cloned tf-text and updated WORKSPACE
And I run BUT when I install tf-text, it downloads tf 2.3.1. And it's not what I expect
I need tf-2.4.0 on purpose, but installation of the text removes it. What should I do? |
Oh, this is because the setup.py of the python package has that version range defined. That value is just telling pip what to do, so you can either update setuip.py and rebuild so pip accepts your tf version, or reinstall the tensorflow version you desire after installing tensorflow_text. |
I've just removed @broken , thank you very much for you help! Now I can continue with another issue ( tensorflow/tensorflow#42673 (comment) ) |
Hi! I'm getting this error at:
tensorflow_text==2.4.0rc0 (the only version that exists now) How can I fix this error - I need to import the library in order to load the Albert Preprocessor Module for Tensorflow-Hub:
Not calling this library above raises a different error. |
Echoing Rmsharks4 , can't go backwards here on Windows, there's only one available version of tensorflow_text. tensorflow-text==2.4.0rc0
tensorflow==2.4.0rc2
tensorflow-hub==0.1.0```` |
You are probably on Py3.8. With this being the first Windows release, we had a problem with that build. This should be fixed in the next release candidate coming soon. Py3.7 and 3.6 should work though. |
As I found other places, installing tensorflow 2.3 and tensorflow_text 2.3 can resolve this problem. I did the same, but problem was probably due pip and conda conflicts. When I uninstalled them and install both with pip on base environment problem was resolved. I think since tensorflow_text depends on tensorflow, it's good that it's deployed on conda too. |
maybe you are in the repo |
I have this issue. Tensorflow 2.8 and python 3.8. All packages installed using pip.
|
FYI: The following versions are compatible to each other: |
We finally have instructions on how to use docker images to run our tests on. These images are the same provided by TF. You can find the instructions at the bottom of the README on the home page of this project. |
running python 3.7 on mac osx 10.14.6. Not sure if there is some dependency or build step I am missing but I cannot seem to run the unit tests with out the code failing to load this file. Have tried with tensorflow 1.x and 2.x. stack trace is below. Maybe I am just missing something simple?
The text was updated successfully, but these errors were encountered: