armnn: Errors when building Arm NN

Hello,

I follow this link to build Arm NN with TensorFlow lite. I skip “Build the Google Protocol Buffers library” and “Generate the build dependencies for ONNX” part because I only use Tensorflow Lite. I was able to follow all the steps until “Build Arm NN” part

The only steps I add into or (differ from) the original setting: I add DFLATBUFFERS_LIBRARY option to solve “Flatbuffers library located at: FLATBUFFERS_LIBRARY-NOTFOUND” errors

cmake command I am using:

cmake .. -DARMCOMPUTE_ROOT=$BASEDIR/ComputeLibrary 
-DARMCOMPUTE_BUILD_DIR=$BASEDIR/ComputeLibrary/build 
-DSHARED_BOOT=ON -DBOOST_ROOT=$BASEDIR/boost -DBUILD_TF_LITE_PARSER=1 
-DTF_LITE_GENERATED_PATH=$BASEDIR/flatbuffers-1.12.0/build/tflite 
-DFLATBUFFERS_ROOT=$$BASEDIR/flatbuffers-1.12.0
**-DFLATBUFFERS_LIBRARY=$BASEDIR/flatbuffers-1.12.0/libflatbuffers.a** 
-DFLATC_DIR=$BASEDIR/flatbuffers-1.12.0/build 
-DARMCOMPUTENEON=1 -DARMNNREF=1

cmake result:

-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Flatbuffers headers are located at: /home/shunya/hungyang/armnn-dist/flatbuffers-1.12.0/include
-- Flatbuffers library located at: /home/shunya/hungyang/armnn-dist/flatbuffers-1.12.0/libflatbuffers.a
-- Tf Lite generated header found at: /home/shunya/hungyang/armnn-dist/flatbuffers-1.12.0/build/tflite
-- Looking for valgrind/memcheck.h
-- Looking for valgrind/memcheck.h - not found
-- Armnn Serializer support is disabled
-- PyArmNN wheel package is disabled
-- PyArmNN source package is disabled
-- Including backend common library into the build: /home/shunya/hungyang/armnn-dist/armnn/src/backends/aclCommon/common.cmake
-- Including backend common library into the build: /home/shunya/hungyang/armnn-dist/armnn/src/backends/backendsCommon/common.cmake
-- Including backend into the build: /home/shunya/hungyang/armnn-dist/armnn/src/backends/cl/backend.cmake
-- CL backend is disabled
-- Including backend into the build: /home/shunya/hungyang/armnn-dist/armnn/src/backends/neon/backend.cmake
-- Including backend into the build: /home/shunya/hungyang/armnn-dist/armnn/src/backends/reference/backend.cmake
-- Adding object library dependency to armnn: armnnAclCommon
-- Adding object library dependency to armnn: armnnBackendsCommon
-- Adding object library dependency to armnn: armnnClBackend
-- Adding object library dependency to armnn: armnnNeonBackend
-- Adding object library dependency to armnn: armnnNeonBackendWorkloads
-- Adding object library dependency to armnn: armnnRefBackend
-- Adding object library dependency to armnn: armnnRefBackendWorkloads
-- Adding object library dependency to UnitTests: armnnAclCommonUnitTests
-- Adding object library dependency to UnitTests: armnnBackendsCommonUnitTests
-- Adding object library dependency to UnitTests: armnnNeonBackendUnitTests
-- Adding object library dependency to UnitTests: armnnRefBackendUnitTests
-- CMAKE_CURRENT_LIST_DIR /home/shunya/hungyang/armnn-dist/armnn
-- CMAKE_CURRENT_BINARY_DIR /home/shunya/hungyang/armnn-dist/armnn/build
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    BOOST_ROOT
    SHARED_BOOT

-- Build files have been written to: /home/shunya/hungyang/armnn-dist/armnn/build

But it always shows errors when the progress at 49% I have tried flatbuffers-1.10.0 version but I still get the same errors at 49% when using “make” command. image

More info: the platform I am using is HiKey 970 image

Thanks for your help in advance 😃

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16

Commits related to this issue

Most upvoted comments

Hi, @FrancisMurtagh-arm I am using the latest version of both TensorFlow (2.4.3) and armNN (21.08). I will try to use ARM NN 21.05 as @payaljindal suggest and see what I get. And the attachment is schema_generated.h file schema_generated.h.zip

Hi @HungYangChang, we support TensorFlow version 2.3.1, as mentioned in our release notes, could you try with ArmNN 21.08 and Tensorflow 2.3.1?

@payaljindal Thanks for the nice explaining. Also, I think shape_signature in tflite parser is somehow missing or not working correctly. Could @FrancisMurtagh-arm check that?

Thanks for your help in advance 😃

Hi @FrancisMurtagh-arm, I used a different version of Arm NN(21.05). Now, I am able to build successfully.

Thanks, Payal

@payaljindal May I ask which version of ARM compute library are you using? Is it 21.08 or 21.05?

Hi @FrancisMurtagh-arm, I used a different version of Arm NN(21.05). Now, I am able to build successfully.

Thanks, Payal

Hi @HungYangChang & @payaljindal,

Could you post your schema_generated.h and confirm your Tensorflow version?

Thanks, Francis.

@payaljindal I still cannot figure that out. But I will update here if I get any progress. I think ARM developers might reply on Tuesday since Monday is Labor day.

I am also facing the same error. @HungYangChang if you found any solution, please put it here as well. Thanks in advance.

Hello @FrancisMurtagh-arm

I tried to follow your sugeestion

$ mkdir tflite
$ cd tflite
$ cp $BASEDIR/tensorflow/tensorflow/lite/schema/schema.fbs .
$ $BASEDIR/flatbuffers-1.12.0/build/flatc -c --gen-object-api --reflect-types --reflect-names schema.fbs

And here is the tflite path:

shunya@hikey970:~/hungyang/armnn-dist/tflite$ ls
schema.fbs  schema_generated.h

And then I use the following command

cmake .. -DARMCOMPUTE_ROOT=$BASEDIR/ComputeLibrary 
-DARMCOMPUTE_BUILD_DIR=$BASEDIR/ComputeLibrary/build 
-DSHARED_BOOT=ON 
-DBOOST_ROOT=$BASEDIR/boost 
-DBUILD_TF_LITE_PARSER=1 
-DTF_LITE_GENERATED_PATH=/home/shunya/hungyang/armnn-dist/tflite 
-DFLATBUFFERS_ROOT=$BASEDIR/flatbuffers-1.12.0 
-DFLATBUFFERS_LIBRARY=$BASEDIR/flatbuffers-1.12.0/libflatbuffers.a
-DFLATC_DIR=$BASEDIR/flatbuffers-1.12.0/build 
-DARMCOMPUTENEON=1 
-DARMNNREF=1 
-DBUILD_TESTS=1


-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Flatbuffers headers are located at: /home/shunya/hungyang/armnn-dist/flatbuffers-1.12.0/include
-- Flatbuffers library located at: /home/shunya/hungyang/armnn-dist/flatbuffers-1.12.0/libflatbuffers.a
-- Tf Lite generated header found at: /home/shunya/hungyang/armnn-dist/tflite
-- Looking for valgrind/memcheck.h
-- Looking for valgrind/memcheck.h - not found
-- Armnn Serializer support is disabled
-- PyArmNN wheel package is disabled
-- PyArmNN source package is disabled
-- Including backend common library into the build: /home/shunya/hungyang/armnn-dist/armnn/src/backends/aclCommon/common.cmake
-- Including backend common library into the build: /home/shunya/hungyang/armnn-dist/armnn/src/backends/backendsCommon/common.cmake
-- Including backend into the build: /home/shunya/hungyang/armnn-dist/armnn/src/backends/cl/backend.cmake
-- CL backend is disabled
-- Including backend into the build: /home/shunya/hungyang/armnn-dist/armnn/src/backends/neon/backend.cmake
-- Including backend into the build: /home/shunya/hungyang/armnn-dist/armnn/src/backends/reference/backend.cmake
-- Adding object library dependency to armnn: armnnAclCommon
-- Adding object library dependency to armnn: armnnBackendsCommon
-- Adding object library dependency to armnn: armnnClBackend
-- Adding object library dependency to armnn: armnnNeonBackend
-- Adding object library dependency to armnn: armnnNeonBackendWorkloads
-- Adding object library dependency to armnn: armnnRefBackend
-- Adding object library dependency to armnn: armnnRefBackendWorkloads
-- Adding object library dependency to UnitTests: armnnAclCommonUnitTests
-- Adding object library dependency to UnitTests: armnnBackendsCommonUnitTests
-- Adding object library dependency to UnitTests: armnnNeonBackendUnitTests
-- Adding object library dependency to UnitTests: armnnRefBackendUnitTests
-- CMAKE_CURRENT_LIST_DIR /home/shunya/hungyang/armnn-dist/armnn
-- CMAKE_CURRENT_BINARY_DIR /home/shunya/hungyang/armnn-dist/armnn/build
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    BOOST_ROOT
    SHARED_BOOT


-- Build files have been written to: /home/shunya/hungyang/armnn-dist/armnn/build

But I still get the same error:

Scanning dependencies of target armnnTfLiteParser
[ 46%] Building CXX object src/armnnTfLiteParser/CMakeFiles/armnnTfLiteParser.dir/TfLiteParser.cpp.o
/home/shunya/hungyang/armnn-dist/armnn/src/armnnTfLiteParser/TfLiteParser.cpp: In function 'armnn::TensorInfo armnnTfLiteParser::{anonymous}::ToTensorInfo(armnnTfLiteParser::TfLiteParserImpl::TensorRawPtr, const std::vector<unsigned int>&, bool)':
/home/shunya/hungyang/armnn-dist/armnn/src/armnnTfLiteParser/TfLiteParser.cpp:429:48: error: 'const struct tflite::TensorT' has no member named 'shape_signature'
         size_t shapeSignatureSize = tensorPtr->shape_signature.size();
                                                ^~~~~~~~~~~~~~~
/home/shunya/hungyang/armnn-dist/armnn/src/armnnTfLiteParser/TfLiteParser.cpp:441:51: error: 'const struct tflite::TensorT' has no member named 'shape_signature'
                     unsigned int dim = tensorPtr->shape_signature[i] > -1 ?
                                                   ^~~~~~~~~~~~~~~
/home/shunya/hungyang/armnn-dist/armnn/src/armnnTfLiteParser/TfLiteParser.cpp:442:77: error: 'const struct tflite::TensorT' has no member named 'shape_signature'
                                        static_cast<unsigned int>(tensorPtr->shape_signature[i]) : 0;
                                                                             ^~~~~~~~~~~~~~~
/home/shunya/hungyang/armnn-dist/armnn/src/armnnTfLiteParser/TfLiteParser.cpp:447:83: error: 'const struct tflite::TensorT' has no member named 'shape_signature'
             std::unique_ptr<bool[]> dimMask = std::make_unique<bool[]>(tensorPtr->shape_signature.size());
                                                                                   ^~~~~~~~~~~~~~~
/home/shunya/hungyang/armnn-dist/armnn/src/armnnTfLiteParser/TfLiteParser.cpp:448:53: error: 'const struct tflite::TensorT' has no member named 'shape_signature'
             for (unsigned int i = 0; i < tensorPtr->shape_signature.size(); ++i)
                                                     ^~~~~~~~~~~~~~~
/home/shunya/hungyang/armnn-dist/armnn/src/armnnTfLiteParser/TfLiteParser.cpp:450:41: error: 'const struct tflite::TensorT' has no member named 'shape_signature'
                 dimMask[i] = tensorPtr->shape_signature[i] == -1 ? false : true;
                                         ^~~~~~~~~~~~~~~
src/armnnTfLiteParser/CMakeFiles/armnnTfLiteParser.dir/build.make:62: recipe for target 'src/armnnTfLiteParser/CMakeFiles/armnnTfLiteParser.dir/TfLiteParser.cpp.o' failed
make[2]: *** [src/armnnTfLiteParser/CMakeFiles/armnnTfLiteParser.dir/TfLiteParser.cpp.o] Error 1
CMakeFiles/Makefile2:391: recipe for target 'src/armnnTfLiteParser/CMakeFiles/armnnTfLiteParser.dir/all' failed
make[1]: *** [src/armnnTfLiteParser/CMakeFiles/armnnTfLiteParser.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

I also find out link (in Mandarin) have a similar issue. Thanks for the help in advacne.

Hi @HungYangChang,

You appear to be using the incorrect DTF_LITE_GENERATED_PATH, it should be pointing to a file called schema_generated.h not what you have /home/shunya/hungyang/armnn-dist/flatbuffers-1.12.0/build/tflite

This is generated using:

/usr/bin/flatc -c --gen-object-api --reflect-types --reflect-names -o path/we/output/to path/to/tensorflow/schema.fbs

In the link you provided there seems to be a typo in schema.fbs:

$ mkdir tflite
$ cd tflite
$ cp $BASEDIR/tensorflow/tensorflow/lite/schema/schema.fbs .
$ $BASEDIR/flatbuffers-1.12.0/build/flatc -c --gen-object-api --reflect-types --reflect-names schema.fbsS   # note extra S

I’ll put a request in for the document to be updated for the typo

Thanks, Francis.