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 #523

Closed
mijung-kim opened this Issue Oct 10, 2016 · 9 comments

Comments

Projects
None yet
9 participants
@mijung-kim
Copy link

mijung-kim commented Oct 10, 2016

Please let us know which model this issue is about (specify the top-level directory)

I add 'import cv2' to use some image preprocessing functions and got the following error.

Traceback (most recent call last):
File "train_image_classifier.py", line 27, in
from preprocessing import preprocessing_factory
File "/home/mijung/BC/models/slim/preprocessing/preprocessing_factory.py", line 27, in
from preprocessing import bc_preprocessing
File "/home/mijung/BC/models/slim/preprocessing/bc_preprocessing.py", line 21, in
import cv2
ImportError: dlopen: cannot load any more object with static TLS

Anyone knows how to solve this?

Thank you in advance!

@jart jart added the stackoverflow label Oct 14, 2016

@jart

This comment has been minimized.

Copy link
Contributor

jart commented Oct 14, 2016

This might be a system configuration error rather than a bug in TensorFlow. The closest thing I can find is this thread on Stack Overflow. You might want to direct the question there for community support.

@jart jart closed this Oct 14, 2016

@pribadihcr

This comment has been minimized.

Copy link

pribadihcr commented Jan 16, 2017

my solution is put import cv2 above import tensorflow. I don't know why the reason.

@mijung-kim

This comment has been minimized.

Copy link

mijung-kim commented Jan 16, 2017

@pribadihcr, I already have tried your method and did not work for me.

@jmugan

This comment has been minimized.

Copy link

jmugan commented Feb 18, 2017

I got this problem when I upgraded to 1.0. After the upgrade, it happens when I import spaCy in a program where I import TensorFlow. This does not occur when I use spaCy without TensorFlow. For now, I pulled out the import of spaCy.

@carsonDB

This comment has been minimized.

Copy link

carsonDB commented Feb 18, 2017

I have the same problem when I import cv2 with the OpenCV's version 3.1.0. But it's ok with the version 2.4.13. And this problem only comes out after I upgraded to 1.0 of tensorflow.
BTW, changing the import order of cv2 and tf can't help me.

@chrishokamp

This comment has been minimized.

Copy link

chrishokamp commented Feb 20, 2017

I had the same issue with tensorflow 1.0 and Spacy 1.5.1, importing spacy before tensorflow fixed it for me.

@stephenhky

This comment has been minimized.

Copy link

stephenhky commented Apr 25, 2017

I have the same issue with spaCy + Tensorflow too.

@ajeetksingh

This comment has been minimized.

Copy link

ajeetksingh commented Sep 5, 2017

I think we need to import tensorflow and related modules only after we have imported all the other modules. I don't know why does it work, but it did the trick for me.

@youkaichao

This comment has been minimized.

Copy link

youkaichao commented Jul 12, 2018

I have the same problem with matplotlib. importing matplotlib before tensorflow does the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment