Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TensorFlow 2.4.0 Raspi --> RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd #5

Open
abdulw976 opened this issue Sep 7, 2021 · 3 comments

Comments

@abdulw976
Copy link

abdulw976 commented Sep 7, 2021

I have succesfully installed tensorflow 2.4.0 in raspi 4 using the build provided.

I initially had numpy 1.19.5 but it gave this error. upgrading to numpy1.21 also gives campatibility error. Currently numpy installed is 1.19.2 but still I am getting the same error.

when I try to import tensorflow, I get the following error.
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd

Can I know why this is happening?

Requirement Details:
Processing ./tensorflow-2.4.0-cp37-none-linux_armv7l.whl
Requirement already satisfied: protobuf>=3.9.2 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (3.17.3)
Requirement already satisfied: flatbuffers~=1.12.0 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (1.12)
Requirement already satisfied: wheel~=0.35 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (0.37.0)
Requirement already satisfied: keras-preprocessing~=1.1.2 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (1.1.2)
Requirement already satisfied: opt-einsum~=3.3.0 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (3.3.0)
Requirement already satisfied: grpcio~=1.32.0 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (1.32.0)
Requirement already satisfied: h5py~=2.10.0 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (2.10.0)
Requirement already satisfied: astunparse~=1.6.3 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (1.6.3)
Requirement already satisfied: typing-extensions~=3.7.4 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (3.7.4.3)
Requirement already satisfied: wrapt~=1.12.1 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (1.12.1)
Requirement already satisfied: google-pasta~=0.2 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (0.2.0)
Requirement already satisfied: numpy~=1.19.2 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (1.19.2)
Requirement already satisfied: six~=1.15.0 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (1.15.0)
Requirement already satisfied: termcolor~=1.1.0 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (1.1.0)
Requirement already satisfied: tensorflow-estimator<2.5.0,>=2.4.0rc0 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (2.4.0)
Requirement already satisfied: absl-py~=0.10 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (0.13.0)
Requirement already satisfied: tensorboard~=2.4 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (2.6.0)
Requirement already satisfied: gast==0.3.3 in ./tf24_env/lib/python3.7/site-packages (from tensorflow==2.4.0) (0.3.3)
Requirement already satisfied: werkzeug>=0.11.15 in ./tf24_env/lib/python3.7/site-packages (from tensorboard~=2.4->tensorflow==2.4.0) (2.0.1)
Requirement already satisfied: requests<3,>=2.21.0 in ./tf24_env/lib/python3.7/site-packages (from tensorboard~=2.4->tensorflow==2.4.0) (2.26.0)
Requirement already satisfied: markdown>=2.6.8 in ./tf24_env/lib/python3.7/site-packages (from tensorboard~=2.4->tensorflow==2.4.0) (3.3.4)
Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in ./tf24_env/lib/python3.7/site-packages (from tensorboard~=2.4->tensorflow==2.4.0) (0.6.1)
Requirement already satisfied: setuptools>=41.0.0 in ./tf24_env/lib/python3.7/site-packages (from tensorboard~=2.4->tensorflow==2.4.0) (58.0.2)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in ./tf24_env/lib/python3.7/site-packages (from tensorboard~=2.4->tensorflow==2.4.0) (1.8.0)
Requirement already satisfied: google-auth<2,>=1.6.3 in ./tf24_env/lib/python3.7/site-packages (from tensorboard~=2.4->tensorflow==2.4.0) (1.35.0)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in ./tf24_env/lib/python3.7/site-packages (from tensorboard~=2.4->tensorflow==2.4.0) (0.4.6)
Requirement already satisfied: charset-normalizer~=2.0.0; python_version >= "3" in ./tf24_env/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow==2.4.0) (2.0.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./tf24_env/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow==2.4.0) (1.26.6)
Requirement already satisfied: idna<4,>=2.5; python_version >= "3" in ./tf24_env/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow==2.4.0) (3.2)
Requirement already satisfied: certifi>=2017.4.17 in ./tf24_env/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow==2.4.0) (2021.5.30)
Requirement already satisfied: importlib-metadata; python_version < "3.8" in ./tf24_env/lib/python3.7/site-packages (from markdown>=2.6.8->tensorboard~=2.4->tensorflow==2.4.0) (4.8.1)
Requirement already satisfied: rsa<5,>=3.1.4; python_version >= "3.6" in ./tf24_env/lib/python3.7/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.4->tensorflow==2.4.0) (4.7.2)
Requirement already satisfied: pyasn1-modules>=0.2.1 in ./tf24_env/lib/python3.7/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.4->tensorflow==2.4.0) (0.2.8)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in ./tf24_env/lib/python3.7/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.4->tensorflow==2.4.0) (4.2.2)
Requirement already satisfied: requests-oauthlib>=0.7.0 in ./tf24_env/lib/python3.7/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow==2.4.0) (1.3.0)
Requirement already satisfied: zipp>=0.5 in ./tf24_env/lib/python3.7/site-packages (from importlib-metadata; python_version < "3.8"->markdown>=2.6.8->tensorboard~=2.4->tensorflow==2.4.0) (3.5.0)
Requirement already satisfied: pyasn1>=0.1.3 in ./tf24_env/lib/python3.7/site-packages (from rsa<5,>=3.1.4; python_version >= "3.6"->google-auth<2,>=1.6.3->tensorboard~=2.4->tensorflow==2.4.0) (0.4.8)
Requirement already satisfied: oauthlib>=3.0.0 in ./tf24_env/lib/python3.7/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow==2.4.0) (3.1.1)
Installing collected packages: tensorflow
Successfully installed tensorflow-2.4.0

@MegaCreater
Copy link

MegaCreater commented Feb 19, 2022

I was facing same issue in raspberry pi 3. Actually the error is with pandas. Although tensorflow need numpy~=1.19.2 , but pandas is not compliable with it. So, I have upgraded (because downgrading is not) my numpy to latest version and all works fine!!!!.

    root@raspberrypi:/home/pi# python3
    Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
    [GCC 8.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import numpy as np 
    >>> np.__version__
    '1.21.5'
    >>> import pandas as pd
    >>> pd.__version__
    '1.3.5'
    >>> import tensorflow as tf
    >>> tf.__version__
    '2.4.0'
    >>> tf.keras.__version__
    '2.4.0'
    >>> tf.keras.layers
    <module 'tensorflow.keras.layers' from '/usr/local/lib/python3.7/dist-packages/tensorflow/keras/layers/__init__.py'>

Same issue here also - https://stackoverflow.com/questions/66060487/valueerror-numpy-ndarray-size-changed-may-indicate-binary-incompatibility-exp/71183166#71183166

Try it out!!!!!!!!!!!!!!
And this repository owner is useless! People are facing issues and he/she is sleeping .......

@leigh-johnson
Copy link
Member

I was facing same issue in raspberry pi 3. Actually the error is with pandas. Although tensorflow need numpy~=1.19.2 , but pandas is not compliable with it. So, I have upgraded (because downgrading is not) my numpy to latest version and all works fine!!!!.

    root@raspberrypi:/home/pi# python3
    Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
    [GCC 8.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import numpy as np 
    >>> np.__version__
    '1.21.5'
    >>> import pandas as pd
    >>> pd.__version__
    '1.3.5'
    >>> import tensorflow as tf
    >>> tf.__version__
    '2.4.0'
    >>> tf.keras.__version__
    '2.4.0'
    >>> tf.keras.layers
    <module 'tensorflow.keras.layers' from '/usr/local/lib/python3.7/dist-packages/tensorflow/keras/layers/__init__.py'>

Same issue here also - https://stackoverflow.com/questions/66060487/valueerror-numpy-ndarray-size-changed-may-indicate-binary-incompatibility-exp/71183166#71183166

Try it out!!!!!!!!!!!!!! And this repository owner is useless! People are facing issues and he/she is sleeping .......

Hey @MegaCreater, thanks for digging into this and posting your fix.

I primarily use C++/Rust for embedded development lately (not Python), and I'm heads down on building PrintNanny. This is a community-maintained project - Google and the TensorFlow team do not pay me to provide support.

Contributions are welcome through. Here's the build script I used to create the binaries in the README.
https://github.com/bitsy-ai/tensorflow-arm-bin/blob/main/scripts/build_raspberry_pi.sh

@MegaCreater
Copy link

@leigh-johnson Thanks for your support and work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants