ARM-software / armnn

Arm NN ML Software. The code here is a read-only mirror of https://review.mlplatform.org/admin/repos/ml/armnn
https://developer.arm.com/products/processors/machine-learning/arm-nn
MIT License
1.17k stars 309 forks source link

ArmNN 22.08 fails to build with TF-lite 2.9.1 and flatbuffers 2.0.6 #688

Closed ggardet closed 2 years ago

ggardet commented 2 years ago

Log:

[  740s] [ 56%] Building CXX object src/armnnTfLiteParser/CMakeFiles/armnnTfLiteParser.dir/TfLiteParser.cpp.o
[  740s] cd /home/abuild/rpmbuild/BUILD/armnn-22.08/build/src/armnnTfLiteParser && /usr/bin/c++ -DARMCOMPUTENEON_ENABLED -DARMNNREF_ENABLED -DARMNN_SERIALIZER -DARMNN_SERIALIZER_SCHEMA_PATH=\"/home/abuild/rpmbuild/BUILD/armnn-22.08/src/armnnSerializer/ArmnnSchema.fbs\" -DARMNN_TF_LITE_PARSER -DDYNAMIC_BACKEND_BUILD_DIR=\"/home/abuild/rpmbuild/BUILD/armnn-22.08/build\" -DarmnnTfLiteParser_EXPORTS -I/home/abuild/rpmbuild/BUILD/armnn-22.08/include -I/home/abuild/rpmbuild/BUILD/armnn-22.08/profiling -I/home/abuild/rpmbuild/BUILD/armnn-22.08/src/armnnTfLiteParser/../armnn -I/home/abuild/rpmbuild/BUILD/armnn-22.08/src/armnnTfLiteParser/../armnnUtils -isystem /home/abuild/rpmbuild/BUILD/armnn-22.08/third-party -isystem /usr/include/half -isystem /usr/include/tensorflow/lite/schema -mbranch-protection=standard -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type  -g -pthread -std=c++14 -Wall -Wextra -Werror -Wold-style-cast -Wno-missing-braces -Wconversion -Wsign-conversion  -Wno-psabi -O2 -g  -fPIC -Wno-conversion -Wno-sign-conversion -Wno-unused-parameter -Wno-unused-function -MD -MT src/armnnTfLiteParser/CMakeFiles/armnnTfLiteParser.dir/TfLiteParser.cpp.o -MF CMakeFiles/armnnTfLiteParser.dir/TfLiteParser.cpp.o.d -o CMakeFiles/armnnTfLiteParser.dir/TfLiteParser.cpp.o -c /home/abuild/rpmbuild/BUILD/armnn-22.08/src/armnnTfLiteParser/TfLiteParser.cpp
[  740s] In file included from /home/abuild/rpmbuild/BUILD/armnn-22.08/src/armnnTfLiteParser/TfLiteParser.hpp:11,
[  740s]                  from /home/abuild/rpmbuild/BUILD/armnn-22.08/src/armnnTfLiteParser/TfLiteParser.cpp:6:
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h: In member function 'bool tflite::QuantizationParameters::Verify(flatbuffers::Verifier&) const':
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h:3406:32: error: no matching function for call to 'tflite::QuantizationParameters::VerifyField<uint8_t>(flatbuffers::Verifier&, tflite::QuantizationParameters::FlatBuffersVTableOffset) const'
[  740s]  3406 |            VerifyField<uint8_t>(verifier, VT_DETAILS_TYPE) &&
[  740s]       |            ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
[  740s] In file included from /usr/include/flatbuffers/flatbuffer_builder.h:31,
[  740s]                  from /usr/include/flatbuffers/flatbuffers.h:27,
[  740s]                  from /usr/include/tensorflow/lite/schema/schema_generated.h:21:
[  740s] /usr/include/flatbuffers/table.h:115:8: note: candidate: 'template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const'
[  740s]   115 |   bool VerifyField(const Verifier &verifier, voffset_t field,
[  740s]       |        ^~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note:   candidate expects 3 arguments, 2 provided
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h:3409:32: error: no matching function for call to 'tflite::QuantizationParameters::VerifyField<int32_t>(flatbuffers::Verifier&, tflite::QuantizationParameters::FlatBuffersVTableOffset) const'
[  740s]  3409 |            VerifyField<int32_t>(verifier, VT_QUANTIZED_DIMENSION) &&
[  740s]       |            ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note: candidate: 'template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const'
[  740s]   115 |   bool VerifyField(const Verifier &verifier, voffset_t field,
[  740s]       |        ^~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note:   candidate expects 3 arguments, 2 provided
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h: In member function 'bool tflite::DimensionMetadata::Verify(flatbuffers::Verifier&) const':
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h:3756:31: error: no matching function for call to 'tflite::DimensionMetadata::VerifyField<int8_t>(flatbuffers::Verifier&, tflite::DimensionMetadata::FlatBuffersVTableOffset) const'
[  740s]  3756 |            VerifyField<int8_t>(verifier, VT_FORMAT) &&
[  740s]       |            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note: candidate: 'template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const'
[  740s]   115 |   bool VerifyField(const Verifier &verifier, voffset_t field,
[  740s]       |        ^~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note:   candidate expects 3 arguments, 2 provided
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h:3757:32: error: no matching function for call to 'tflite::DimensionMetadata::VerifyField<int32_t>(flatbuffers::Verifier&, tflite::DimensionMetadata::FlatBuffersVTableOffset) const'
[  740s]  3757 |            VerifyField<int32_t>(verifier, VT_DENSE_SIZE) &&
[  740s]       |            ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note: candidate: 'template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const'
[  740s]   115 |   bool VerifyField(const Verifier &verifier, voffset_t field,
[  740s]       |        ^~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note:   candidate expects 3 arguments, 2 provided
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h:3758:32: error: no matching function for call to 'tflite::DimensionMetadata::VerifyField<uint8_t>(flatbuffers::Verifier&, tflite::DimensionMetadata::FlatBuffersVTableOffset) const'
[  740s]  3758 |            VerifyField<uint8_t>(verifier, VT_ARRAY_SEGMENTS_TYPE) &&
[  740s]       |            ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note: candidate: 'template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const'
[  740s]   115 |   bool VerifyField(const Verifier &verifier, voffset_t field,
[  740s]       |        ^~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note:   candidate expects 3 arguments, 2 provided
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h:3761:32: error: no matching function for call to 'tflite::DimensionMetadata::VerifyField<uint8_t>(flatbuffers::Verifier&, tflite::DimensionMetadata::FlatBuffersVTableOffset) const'
[  740s]  3761 |            VerifyField<uint8_t>(verifier, VT_ARRAY_INDICES_TYPE) &&
[  740s]       |            ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note: candidate: 'template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const'
[  740s]   115 |   bool VerifyField(const Verifier &verifier, voffset_t field,
[  740s]       |        ^~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note:   candidate expects 3 arguments, 2 provided
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h: In member function 'bool tflite::Tensor::Verify(flatbuffers::Verifier&) const':
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h:3999:31: error: no matching function for call to 'tflite::Tensor::VerifyField<int8_t>(flatbuffers::Verifier&, tflite::Tensor::FlatBuffersVTableOffset) const'
[  740s]  3999 |            VerifyField<int8_t>(verifier, VT_TYPE) &&
[  740s]       |            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note: candidate: 'template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const'
[  740s]   115 |   bool VerifyField(const Verifier &verifier, voffset_t field,
[  740s]       |        ^~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note:   candidate expects 3 arguments, 2 provided
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h:4000:33: error: no matching function for call to 'tflite::Tensor::VerifyField<uint32_t>(flatbuffers::Verifier&, tflite::Tensor::FlatBuffersVTableOffset) const'
[  740s]  4000 |            VerifyField<uint32_t>(verifier, VT_BUFFER) &&
[  740s]       |            ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note: candidate: 'template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const'
[  740s]   115 |   bool VerifyField(const Verifier &verifier, voffset_t field,
[  740s]       |        ^~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note:   candidate expects 3 arguments, 2 provided
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h:4005:32: error: no matching function for call to 'tflite::Tensor::VerifyField<uint8_t>(flatbuffers::Verifier&, tflite::Tensor::FlatBuffersVTableOffset) const'
[  740s]  4005 |            VerifyField<uint8_t>(verifier, VT_IS_VARIABLE) &&
[  740s]       |            ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note: candidate: 'template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const'
[  740s]   115 |   bool VerifyField(const Verifier &verifier, voffset_t field,
[  740s]       |        ^~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note:   candidate expects 3 arguments, 2 provided
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h: In member function 'bool tflite::Conv2DOptions::Verify(flatbuffers::Verifier&) const':
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h:4153:31: error: no matching function for call to 'tflite::Conv2DOptions::VerifyField<int8_t>(flatbuffers::Verifier&, tflite::Conv2DOptions::FlatBuffersVTableOffset) const'
[  740s]  4153 |            VerifyField<int8_t>(verifier, VT_PADDING) &&
[  740s]       |            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note: candidate: 'template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const'
[  740s]   115 |   bool VerifyField(const Verifier &verifier, voffset_t field,
[  740s]       |        ^~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note:   candidate expects 3 arguments, 2 provided
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h:4154:32: error: no matching function for call to 'tflite::Conv2DOptions::VerifyField<int32_t>(flatbuffers::Verifier&, tflite::Conv2DOptions::FlatBuffersVTableOffset) const'
[  740s]  4154 |            VerifyField<int32_t>(verifier, VT_STRIDE_W) &&
[  740s]       |            ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note: candidate: 'template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const'
[  740s]   115 |   bool VerifyField(const Verifier &verifier, voffset_t field,
[  740s]       |        ^~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note:   candidate expects 3 arguments, 2 provided
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h:4155:32: error: no matching function for call to 'tflite::Conv2DOptions::VerifyField<int32_t>(flatbuffers::Verifier&, tflite::Conv2DOptions::FlatBuffersVTableOffset) const'
[  740s]  4155 |            VerifyField<int32_t>(verifier, VT_STRIDE_H) &&
[  740s]       |            ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note: candidate: 'template<class T> bool flatbuffers::Table::VerifyField(const flatbuffers::Verifier&, flatbuffers::voffset_t, size_t) const'
[  740s]   115 |   bool VerifyField(const Verifier &verifier, voffset_t field,
[  740s]       |        ^~~~~~~~~~~
[  740s] /usr/include/flatbuffers/table.h:115:8: note:   candidate expects 3 arguments, 2 provided
[  740s] /usr/include/tensorflow/lite/schema/schema_generated.h:4156:31: error: no matching function for call to 'tflite::Conv2DOptions::VerifyField<int8_t>(flatbuffers::Verifier&, tflite::Conv2DOptions::FlatBuffersVTableOffset) const'
[  740s]  4156 |            VerifyField<int8_t>(verifier, VT_FUSED_ACTIVATION_FUNCTION) &&
[  740s]       |            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And more of this kind of errors.

It seems to be similar to https://github.com/ARM-software/armnn/issues/644

matheusfalcaopinto commented 2 years ago

Hi! I have the same problem. I was not able to use the flatbuffers 1.12.0, it just doesn't work here and now I manage to compile the 2.0.8 version but now the armnn give me the same errors at different part of the make command.

matheusfalcaopinto commented 2 years ago

Hi! I was able to build everything by using the build-tool scripts. I don't know how but it works (I think)!

james-conroy-arm commented 2 years ago

Hi @matheusfalcaopinto ,

Could you please share changes you made to the build-tool scripts (if any). i.e. using git diff

Thanks!

matheusfalcaopinto commented 2 years ago

hi! I just follow the instructions found in the section Building without docker here: https://github.com/ARM-software/armnn/tree/branches/armnn_22_08/build-tool

`cd build-tool/scripts

sudo ./install-packages.sh

./setup-armnn.sh --target-arch=aarch64 --all ./build-armnn.sh --target-arch=aarch64 --all --neon-backend --cl-backend --armnn-cmake-args='-DFLATC=/root/armnn/build-tool/scripts/build/flatbuffers/flatc`

The first time I tried building pyarmnn together but it throws me a bunch of erros, so I remove de pyarmnn cmake parameters and it works. But I ended up using the apt packages for debian and I've been able to run the inference examples in the backend cpuacc and cpuref but not yet gpuacc (gives me segmentation error)

ArmRyan commented 2 years ago

Hi @ggardet ,

We currently only support TfLite 2.5 and Flatbuffers 1.12. We will be looking at upgrading in the future, but I can't give any timeline on when.

keidav01 commented 2 years ago

As stated by @ArmRyan, this is future work and we cannot support this issue as a result. Closing

ggardet commented 2 years ago

Without (local) build fix, Armnn will be dropped soon from openSUSE Tumbleweed and will not be part of next openSUSE Leap as well.

FrancisMurtagh-arm commented 1 year ago

Hi @ggardet,

Without (local) build fix, Armnn will be dropped soon from openSUSE Tumbleweed and will not be part of next openSUSE Leap as well.

Since we've updated to TensorFlow 2.10 and Flatbuffers 2.0.6. in 22.11 I hope this has been averted?

Regards, Francis.

ggardet commented 1 year ago

Yes, ArmNN is back in openSUSE Tumbleweed with latest release.