Hi, I have the error below when I import tensorflow into a python script using the system python interpreter. I have the python-tensorflow-cuda and numpy packages installed.
It seems like tensorflow in the extra repo has been compiled with numpy 1.x ?
Any chance that it could be recompiled with numpy 2.x ? Thanks
Traceback (most recent call last): File "/home/xxxxxx/Documents/xxxxxx.py", line 4, in <module>
import tensorflow as tf
File "/usr/lib/python3.12/site-packages/tensorflow/__init__.py", line 46, in <module>
from tensorflow._api.v2 import __internal__
File "/usr/lib/python3.12/site-packages/tensorflow/_api/v2/__internal__/__init__.py", line 8, in <module>
from tensorflow._api.v2.__internal__ import autograph
File "/usr/lib/python3.12/site-packages/tensorflow/_api/v2/__internal__/autograph/__init__.py", line 8, in <module>
from tensorflow.python.autograph.core.ag_ctx import control_status_ctx # line: 34
File "/usr/lib/python3.12/site-packages/tensorflow/python/autograph/core/ag_ctx.py", line 21, in <module>
from tensorflow.python.autograph.utils import ag_logging
File "/usr/lib/python3.12/site-packages/tensorflow/python/autograph/utils/__init__.py", line 17, in <module>
from tensorflow.python.autograph.utils.context_managers import control_dependency_on_returns
File "/usr/lib/python3.12/site-packages/tensorflow/python/autograph/utils/context_managers.py", line 19, in <module>
from tensorflow.python.framework import ops
File "/usr/lib/python3.12/site-packages/tensorflow/python/framework/ops.py", line 46, in <module>
from tensorflow.python import pywrap_tfe
File "/usr/lib/python3.12/site-packages/tensorflow/python/pywrap_tfe.py", line 25, in <module>
from tensorflow.python._pywrap_tfe import *
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/numpy/core/_multiarray_umath.py", line 44, in __getattr__
raise ImportError(msg)
ImportError:
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.