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

Closed
mijung-kim opened this issue Oct 10, 2016 · 11 comments
Closed

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

mijung-kim opened this issue Oct 10, 2016 · 11 comments

Comments

@mijung-kim
Copy link

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
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 as completed Oct 14, 2016
@pribadihcr
Copy link

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

@mijung-kim
Copy link
Author

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

@jmugan
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
Copy link

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
Copy link

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

@stephenhky
Copy link

I have the same issue with spaCy + Tensorflow too.

@ajeetksingh
Copy link

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
Copy link

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

@edugp
Copy link

edugp commented Sep 19, 2019

I was running ubuntu 14.04. I upgraded to 16.04 and it solved it.

@flyskywhy
Copy link

As pytorch/pytorch#2575 said That's also why changing import order can fix things, because if you change it in a way that loads all your "static TLS" libraries first, then future "dynamic TLS" libraries will resize the DTV like normal, I just insert import cv2 at the 1st line of https://github.com/rupeshs/fastsdcpu/blob/main/src/app.py and solve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests