Cannot allocate memory in static TLS block

Hi All,

I using a python 3.10 virtual environment, and try to import tensorflow as tf and import albumentations as A. And i faced a error on cannot allocate memory in static TLS block. Anyone know what is the problem and how to solve it?

I tried LD_PRELOAD = /usr/lib/aarch64-linux-gnu/libgomp.so.1 also

Here is my code:

import os

import cv2

import tensorflow as tf

import albumentations as A

And Error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 5
      3 import cv2
      4 import tensorflow as tf
----> 5 import albumentations as A
      6 # ...existing code...

File /mnt/5958b632-9b58-4b1e-9b06-aaa3d99c9dcd/py10/lib/python3.10/site-packages/albumentations/__init__.py:5
      1 from __future__ import absolute_import
      3 __version__ = "1.3.1"
----> 5 from .augmentations import *
      6 from .core.composition import *
      7 from .core.serialization import *

File /mnt/5958b632-9b58-4b1e-9b06-aaa3d99c9dcd/py10/lib/python3.10/site-packages/albumentations/augmentations/__init__.py:8
      5 from .crops.transforms import *
      7 # New transformations goes to individual files listed below
----> 8 from .domain_adaptation import *
      9 from .dropout.channel_dropout import *
     10 from .dropout.coarse_dropout import *

File /mnt/5958b632-9b58-4b1e-9b06-aaa3d99c9dcd/py10/lib/python3.10/site-packages/albumentations/augmentations/domain_adaptation.py:6
      4 import cv2
      5 import numpy as np

...

   (...)
     26 
     27     """

ImportError: /mnt/5958b632-9b58-4b1e-9b06-aaa3d99c9dcd/py10/lib/python3.10/site-packages/sklearn/utils/../../scikit_learn.libs/libgomp-947d5fa1.so.1.0.0: cannot allocate memory in static TLS block

Hi,

Could you share how you install TensorFlow with us first?
Thanks.

I using pip install tensorflow==2.11.0 at virtual environment

Hi,

The package installed through pip might not build with CUDA support.

But we don’t have the TensorFlow prebuilt package anymore.
Could you use PyTorch instead? If yes, please find it in the link below:

Thanks.

My inference script requires TensorFlow and the albumentations library. Possible to run TensorFlow?

Hi,

You can find our latest TensorFlow support (25.02) below:

Or you can also try to build it from the source.
Thanks.