Cannot run tensorflow-macos-2.10.0

When I tried to run Onnx, it needs the version of tensorflow above 2.10. So I install tensorflow-macos-2.10.0 and run, but it cannot run and had a error as below

Successfully installed tensorflow-macos-2.10.0

(mlp) seunghyunoh@MacBook-Pro-OSH ~ % python

Python 3.8.13 (default, Mar 28 2022, 06:13:39) 

[Clang 12.0.0 ] :: Anaconda, Inc. on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import tensorflow 

RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf

ImportError: numpy.core.multiarray failed to import



The above exception was the direct cause of the following exception:



SystemError: <built-in method __contains__ of dict object at 0x112b7b1c0> returned a result with an error set



The above exception was the direct cause of the following exception:



Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/Users/seunghyunoh/miniforge3/envs/mlp/lib/python3.8/site-packages/tensorflow/__init__.py", line 37, in <module>

    from tensorflow.python.tools import module_util as _module_util

  File "/Users/seunghyunoh/miniforge3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/__init__.py", line 37, in <module>

    from tensorflow.python.eager import context

  File "/Users/seunghyunoh/miniforge3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/eager/context.py", line 35, in <module>

    from tensorflow.python.client import pywrap_tf_session

  File "/Users/seunghyunoh/miniforge3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/client/pywrap_tf_session.py", line 19, in <module>

    from tensorflow.python.client._pywrap_tf_session import *

ImportError: initialization failed

I am using M1 MacPro and previously, tensorflow-macos-2.9.1 worked well. Please check this part and I hope it will be solved.

Hi @DanielOh,

To resolve this issue you should install the recent numpy version. Please try conda install -c apple tensorflow-deps --force-reinstall or conda install numpy --force-reinstall

Are you able to follow “Frameworks Engineer” and get this issue resolved?

Cannot run tensorflow-macos-2.10.0
 
 
Q