Skip to content
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

ImportError: dlopen: cannot load any more object with static TLS #3

Closed
kenyeung128 opened this issue Apr 25, 2017 · 8 comments

Comments

@kenyeung128
Copy link

commented Apr 25, 2017

Hi, I got the following error when i import shorttext, how shall i resolve?

Using TensorFlow backend.

I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so.7.5 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so.7.5 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so.7.5 locally
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/shorttext/init.py", line 7, in
from . import utils
File "/usr/local/lib/python2.7/dist-packages/shorttext/utils/init.py", line 3, in
from . import gensim_corpora
File "/usr/local/lib/python2.7/dist-packages/shorttext/utils/gensim_corpora.py", line 2, in
from .textpreprocessing import spacy_tokenize as tokenize
File "/usr/local/lib/python2.7/dist-packages/shorttext/utils/textpreprocessing.py", line 5, in
import spacy
File "/usr/local/lib/python2.7/dist-packages/spacy/init.py", line 8, in
from . import en, de, zh, es, it, hu, fr, pt, nl, sv, fi, bn, he
File "/usr/local/lib/python2.7/dist-packages/spacy/en/init.py", line 4, in
from ..language import Language
File "/usr/local/lib/python2.7/dist-packages/spacy/language.py", line 12, in
from .syntax.parser import get_templates
ImportError: dlopen: cannot load any more object with static TLS

@stephenhky

This comment has been minimized.

Copy link
Owner

commented Apr 25, 2017

It looks like it is a spaCy issue. It requires the most updated spaCy. Is yours the most updated one? Let me know if you can successfully import the library after you reinstall. It may be on the side of the package.

@kenyeung128

This comment has been minimized.

Copy link
Author

commented Apr 25, 2017

yes, i used latest version of spaCy 1.8.1, and get this error

@stephenhky

This comment has been minimized.

Copy link
Owner

commented Apr 25, 2017

How about running this in terminal?

python -m spacy download en

After downloading the library, try to import the package again.

@kenyeung128

This comment has been minimized.

Copy link
Author

commented Apr 25, 2017

it doesn't help, as i have used the english model already.

but i have found a workaround, I need to do this.

import spacy
import shorttext

then it works

@stephenhky

This comment has been minimized.

Copy link
Owner

commented Apr 25, 2017

Hi Ken... Thanks for letting me know. I think I need some time to figure out what was going on.

@stephenhky

This comment has been minimized.

Copy link
Owner

commented Apr 25, 2017

What is your version of Tensorflow?

@stephenhky

This comment has been minimized.

Copy link
Owner

commented Apr 26, 2017

I changed my backend between Tensorflow and Theano, and I do not have the problem that you posted. I am using Python 2.7. I am running on macOS Sierra.

I googled online that it looks like previous version of tensorflow would give rise to this problem. Mine is pretty new (not sure if it is the newest). I am not sure if that could be the case.

@stephenhky

This comment has been minimized.

Copy link
Owner

commented Apr 27, 2017

It looks like it is not a bug, but a configuration error regarding the numerical libraries. spaCy makes use of CV2, which causes this problem.

The Github of Tensorflow talked about this problem: tensorflow/models#523
And it cited this thread in StackOverflow: http://stackoverflow.com/questions/19268293/matlab-error-cannot-open-with-static-tls

The way to do it is to reload the library, or reinstall Tensorflow etc. To work around, load opencv2, or spaCy first before loading the library.

@stephenhky stephenhky closed this Apr 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.