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

Larq Zoo Tutorial no tensorflow install on Aarch64 #865

Open
StuartIanNaylor opened this issue Nov 29, 2023 · 2 comments
Open

Larq Zoo Tutorial no tensorflow install on Aarch64 #865

StuartIanNaylor opened this issue Nov 29, 2023 · 2 comments

Comments

@StuartIanNaylor
Copy link

StuartIanNaylor commented Nov 29, 2023

Is it just missing tensorflow-aarch64?
As ended up in a dependancy battle with protobuf<=3.19.6
Just failed with tensorflow-aarch64==2.8.4 protobuf==3.19.6 numpy==1.19.5 after much version hopping
I am getting the usual wrong numpy version error

RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import

When I try to build lower I get a new one which is almost like the compiler is confused with mat/mul and what is a Cortex A76

       aarch64-linux-gnu-gcc: build/src.linux-aarch64-3.10/numpy/core/src/umath/matmul.c
      error: Command "aarch64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werroat-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DNPY_INTERNAL_BUILD=1 -DPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Ibuild/src.linux-aarch64-3.10/numpy/core/src/common -Ibuild/src.linch64-3.10/numpy/core/src/umath -Inumpy/core/include -Ibuild/src.linux-aarch64-3.10/numpy/core/include/numpy -Ibuild/src.linux-aarch64-3.10/numpy/distutclude -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/srort -Inumpy/core/src/_simd -I/home/stuart/larq/venv/include -I/usr/include/python3.10 -Ibuild/src.linux-aarch64-3.10/numpy/core/src/common -Ibuild/src.aarch64-3.10/numpy/core/src/npymath -c build/src.linux-aarch64-3.10/numpy/core/src/multiarray/scalartypes.c -o build/temp.linux-aarch64-3.10/build/src.aarch64-3.10/numpy/core/src/multiarray/scalartypes.o -MMD -MF build/temp.linux-aarch64-3.10/build/src.linux-aarch64-3.10/numpy/core/src/multiarray/scals.o.d" failed with exit status 1

      ########### EXT COMPILER OPTIMIZATION ###########
      Platform      :
        Architecture: aarch64
        Compiler    : gcc

      CPU baseline  :
        Requested   : 'min'
        Enabled     : NEON NEON_FP16 NEON_VFPV4 ASIMD
        Flags       : none
        Extra checks: none

      CPU dispatch  :
        Requested   : 'max -xop -fma4'
        Enabled     : ASIMDHP ASIMDDP
        Generated   : none
      CCompilerOpt._cache_write[796] : write cache to path -> /tmp/pip-install-dgxocg45/numpy_08742c2ca1e3478a868e68c793a8f8e1/build/temp.linux-aarch64ccompiler_opt_cache_ext.py

      ########### CLIB COMPILER OPTIMIZATION ###########
      Platform      :
        Architecture: aarch64
        Compiler    : gcc

      CPU baseline  :
        Requested   : 'min'
        Enabled     : NEON NEON_FP16 NEON_VFPV4 ASIMD
        Flags       : none
        Extra checks: none

      CPU dispatch  :
        Requested   : 'max -xop -fma4'
        Enabled     : ASIMDHP ASIMDDP
        Generated   : none
      CCompilerOpt._cache_write[796] : write cache to path -> /tmp/pip-install-dgxocg45/numpy_08742c2ca1e3478a868e68c793a8f8e1/build/temp.linux-aarch64ccompiler_opt_cache_clib.py

Its the dependancy for protobuf<=3.19.6 that kicks this all off and is there any chance it could be updated as think later versions would just then install?

PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
Linux stuart-desktop 5.10.160-rockchip #22 SMP Tue Nov 28 04:00:21 UTC 2023 aarch64 aarch64 aarch64 GNU
pip install larq larq-zoo 
import tensorflow as tf
import tensorflow_datasets as tfds
import numpy as np
import larq_zoo as lqz
from urllib.request import urlopen
from PIL import Image

fails as there is no tensorflow install and then all the above ?

@lgeiger
Copy link
Member

lgeiger commented Nov 29, 2023

This sounds like an issue with TensorFlow on AArch64. I'm not sure how well this is currently supported. Are you able to install and run Keras/TensorFlow code without larq?

@StuartIanNaylor
Copy link
Author

StuartIanNaylor commented Nov 29, 2023

Yeah you have a protobuf version requirement <=3.19.6 and that kicks off a whole rake of problems that brings in pip problems.
Just been spending week with near all frameworks from ncnn to torch, onnx tensorflow all run fine but that old max version of protbuf stops the show.
Its a shame as was intrigued how a cortex A76 would do with BNN's
[EDIT]

(venv) stuart@stuart-desktop:~/zoo$ python quicknet.py
WARNING:tensorflow:From /home/stuart/zoo/venv/lib/python3.10/site-packages/tensorflow/python/util/dispatch.py:1260: resize_bicubic (from tensorflow.python.ops.image_ops_impl) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.image.resize(...method=ResizeMethod.BICUBIC...)` instead.
1/1 [==============================] - 1s 1s/step

Get rid of the max version of protobuf and change to tensorflow-aarch63 and install via a git clone .
Now no problem with dependancies but expecting there should of been output.

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

2 participants