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

Hi, I’m trying to import both torch and tensorflow in the same python program, but I’m getting this error every time:
ImportError: dlopen: cannot load any more object with static TLS

To reproduce it, I can do either:
import torch
import tensorflow
or
import tensorflow
import torch

Not sure exactly where to go with this. Googlging for a solution didn’t help me much. It mainly suggested recompiling glibc with a larger DTV surplus setting (32 instead of 16).

python version is 3.6.1+
torch version is 0.2.0_3
tensorflow version is 1.3.0
linux kernel 3.19.0-68-generic

I’d greatly appreciate some insights. My backup solution is to put all the torch code in an external script.

1 Like

I have the same problem when I import tensorboardX and torch, if import torch first, the error is gone.

i’m looking into this. Please follow this github issue, I will close it once a fix is done.