Issue
I'm using a Jetson Nano and I already tried reinstalling tensorflow (tried different versions) and numpy (also different versions). I'm using the pip3
commands, since I'm using python3
(version 3.6.9).
Downgrading everything didn't work, since Keras needs tensorflow >2.2
I also tried reinstalling scikit-learn, using the --force-reinstall
flag.
Since it might be helpful, here is the full error message I receive when trying to run my program:
Traceback (most recent call last):
File "/home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/__init__.py", line 44, in <module>
from ._check_build import check_build # noqa
ImportError: /home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/../../scikit_learn.libs/libgomp-d22c30c5.so.1.0.0: cannot allocate memory in static TLS block
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "LSTMMVMSTSF.py", line 4, in <module>
import sklearn
File "/home/nano/.local/lib/python3.6/site-packages/sklearn/__init__.py", line 81, in <module>
from . import __check_build # noqa: F401
File "/home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/__init__.py", line 46, in <module>
raise_build_error(e)
File "/home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/__init__.py", line 41, in raise_build_error
%s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
ImportError: /home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build/../../scikit_learn.libs/libgomp-d22c30c5.so.1.0.0: cannot allocate memory in static TLS block
___________________________________________________________________________
Contents of /home/nano/.local/lib/python3.6/site-packages/sklearn/__check_build:
__init__.py _check_build.cpython-36m-aarch64-linux-gnu.so__pycache__
setup.py
___________________________________________________________________________
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run `python setup.py install` or
`make` in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
Edit: I forgot to add information on the installation of scikit-learn. I used sudo pip3 install scikit-learn
. The logs of that installment:
sudo pip3 install scikit-learn Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting scikit-learn
Downloading scikit_learn-0.24.2-cp36-cp36m-manylinux2014_aarch64.whl (24.0 MB)
|████████████████████████████████| 24.0 MB 20.5 MB/s
Requirement already satisfied: threadpoolctl>=2.0.0 in /home/nano/.local/lib/python3.6/site-packages (from scikit-learn) (2.1.0)
Requirement already satisfied: joblib>=0.11 in /home/nano/.local/lib/python3.6/site-packages (from scikit-learn) (1.0.1)
Requirement already satisfied: numpy>=1.13.3 in /home/nano/.local/lib/python3.6/site-packages (from scikit-learn) (1.19.0)
Requirement already satisfied: scipy>=0.19.1 in /home/nano/.local/lib/python3.6/site-packages (from scikit-learn) (1.5.4)
Installing collected packages: scikit-learn
Successfully installed scikit-learn-0.24.2
Solution
I found the answer in another post:
There is no actual issue with installing, the order of imports just needs to be changed. In my case, I had to make sklearn
the first import. Further reading here
Answered By - user14490575
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.