Healthyturnover
Healthyturnover

Reputation: 19

Tensorflow shows errors after importing using python

I installed Tensorflow using pyenv. But whenever i import it gives me this error.I am using Debian in raspberry pi4.My python version is 3.7.12 and tensorflow version is 2.5.0.

''' pi@raspberrypi:~/project $ python Python 3.7.12 (default, Mar 22 2022, 14:27:41) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license" for more information.

import tensorflow RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd Traceback (most recent call last): File "", line 1, in File "/home/pi/.pyenv/versions/3.7.12/lib/python3.7/site-packages/tensorflow/init.py", line 41, in from tensorflow.python.tools import module_util as _module_util File "/home/pi/.pyenv/versions/3.7.12/lib/python3.7/site-packages/tensorflow/python/init.py", line 40, in from tensorflow.python.eager import context File "/home/pi/.pyenv/versions/3.7.12/lib/python3.7/site-packages/tensorflow/python/eager/context.py", line 37, in from tensorflow.python.client import pywrap_tf_session File "/home/pi/.pyenv/versions/3.7.12/lib/python3.7/site-packages/tensorflow/python/client/pywrap_tf_session.py", line 23, in from tensorflow.python._pywrap_tf_session import * ImportError: SystemError: <built-in method contains of dict object at 0x7f741852d0> returned a result with an error set '''

Upvotes: 0

Views: 1053

Answers (1)

Hamed Rabiei
Hamed Rabiei

Reputation: 9

The error message tries to say that Tensorflow needs a recent version of numpy. So,try to upgrade numpy pip3 install --upgrade numpy

Upvotes: 0

Related Questions