ImportError: dlopen: cannot load more than object with static TLS

I get an ImportError if OpenCV (cv2) is imported after the tensorflow exporter.

 ubuntu@ip-172-31-2-144 :~/Downloads/opencv-2.4.13/release$ python Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from tensorflow.contrib.session_bundle import exporter I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcublas.so locally I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcudnn.so locally I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcufft.so locally I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcurand.so locally >>> import cv2 Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: dlopen: cannot load any more object with static TLS >>> 

However, it works fine differently:

 ubuntu@ip-172-31-2-144 :~/Downloads/opencv-2.4.13/release$ python Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import cv2 >>> from tensorflow.contrib.session_bundle import exporter I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcublas.so locally I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcudnn.so locally I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcufft.so locally I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcurand.so locally >>> 

Any idea what is going on?

+6
source share
2 answers

I had the same error as you, and I just fixed its import opencv2 a second time. This is a workaround .. but I can continue to work, so ..

+1
source

I had the same problem, but it was resolved. When I import cv2 to jupyter notebook, the same error was displayed, but after that I imported cv2 to terminal (python), after which it worked. And finally, cv2 can be imported on a jupyter laptop. Please try this.

0
source

Source: https://habr.com/ru/post/1011728/


All Articles