tensorflow: [Tensorflow lite] iOS build for any archs fails : error: no matching member function for call to 'Verify'


System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Mac OS X 10.13.3
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version (use command below): 1.9.0
  • Python version: 2.7 / 3.6
  • Bazel version (if compiling from source): NA
  • GCC/Compiler version (if compiling from source): 4.2.1 == compiler ===================================================== Apple LLVM version 9.1.0 (clang-902.0.39.2) Target: x86_64-apple-darwin17.4.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  • CUDA/cuDNN version: NA
  • GPU model and memory: NA
  • Exact command to reproduce: tensorflow/contrib/lite/build_ios_universal_lib.sh

Describe the problem

iOS build for any architecture will fail. I checked ‘verifier’ exist and defined in tensorflow/contrib/lite/tools/ and Verify is in there. If i am right I guess it is related to the feature ‘template deduction’ which is c++11 or gcc version I am not sure if this failure comes from the bug of the code or my environmental setups but I think I throughly read the build documentation and followed the guidelines.

Here is my practice.

  1. I installed xcode from the app store, (success)
  • run xcode-select --install
  1. install homebrew (success)
  2. brew install automake libtool (success)
  3. git cloned tensorflow, (no issue)
  4. download_install_dependencies (success)

Source code / logs

… clang++ -fPIC -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK -pthread -std=c++11 -fPIC -O3 -DNDEBUG -miphoneos-version-min=9.0 -DGEMMLOWP_ALLOW _SLOW_SCALAR_FALLBACK -DTFLITE_USE_APPLE_ACCELERATE_FOR_CONV -fembed-bitcode -Wno-c++11-narrowing -mno-thumb -fno-exceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -arch arm64 -O3 -I. -I/Users/con tinuumai/tensorflow/tensorflow/contrib/lite/…/…/…/ -I/Users/june/tensorflow/tensorflow/contrib/lite/downloads/ -I/Users/conti nuumai/tensorflow/tensorflow/contrib/lite/downloads/eigen -I/Users/june/tensorflow/tensorflow/contrib/lite/downloads/gemmlowp -I /Users/june/tensorflow/tensorflow/contrib/lite/downloads/neon_2_sse -I/Users/june/tensorflow/tensorflow/contrib/lite/down loads/farmhash/src -I/Users/june/tensorflow/tensorflow/contrib/lite/downloads/flatbuffers/include -I/Users/june/tensorflo w/tensorflow/contrib/lite/gen/obj/ -I/usr/local/include -c tensorflow/contrib/lite/kernels/lsh_projection.cc -o /Users/june/tens orflow/tensorflow/contrib/lite/gen/obj/ios_arm64/tensorflow/contrib/lite/kernels/lsh_projection.o clang: warning: argument unused during compilation: ‘-mno-thumb’ [-Wunused-command-line-argument] 5 warnings generated. In file ``` **included from tensorflow/contrib/lite/interpreter.cc:33:
./tensorflow/contrib/lite/schema/schema_generated.h:1730:21: error: no matching member function for call to ‘Verify’
verifier.Verify(min()) &&
~~~~~^~
**
/Users/june/tensorflow/tensorflow/contrib/lite/downloads/flatbuffers/include/flatbuffers/flatbuffers.h:1775:29: note: candidate template ignored: couldn’t infer template argument ‘T’
template<typename T> bool Verify(uoffset_t elem) const {
^ /Users/june/tensorflow/tensorflow/contrib/lite/downloads/flatbuffers/include/flatbuffers/flatbuffers.h:1784:29: note: candidate function template not viable: requires 2 arguments, but 1 was provided
template<typename T> bool Verify(const uint8_t *base, voffset_t elem_off) ^ /Users/june/tensorflow/tensorflow/contrib/lite/downloads/flatbuffers/include/flatbuffers/flatbuffers.h:1763:8: note: candidate function not viable: requires 2 arguments, but 1 was provided bool Verify(uoffset_t elem, size_t elem_len) const { ^ /Users/june/tensorflow/tensorflow/contrib/lite/downloads/flatbuffers/include/flatbuffers/flatbuffers.h:1780:8: note: candidate function not viable: requires 3 arguments, but 1 was provided bool Verify(const uint8_t *base, voffset_t elem_off, size_t elem_len) const { ^ In file included from tensorflow/contrib/lite/interpreter.cc:33: ./tensorflow/contrib/lite/schema/schema_generated.h:1732:21: error: no matching member function for call to ‘Verify’ verifier.Verify(max()) && ~~~~~^~ /Users/june/tensorflow/tensorflow/contrib/lite/downloads/flatbuffers/include/flatbuffers/flatbuffers.h:1775:29: note: candidate template ignored: couldn’t infer template argument ‘T’ template<typename T> bool Verify(uoffset_t elem) const { ^ /Users/june/tensorflow/tensorflow/contrib/lite/downloads/flatbuffers/include/flatbuffers/flatbuffers.h:1784:29: note: candidate function template not viable: requires 2 arguments, but 1 was provided template<typename T> bool Verify(const uint8_t *base, voffset_t elem_off) ^ /Users/june/tensorflow/tensorflow/contrib/lite/downloads/flatbuffers/include/flatbuffers/flatbuffers.h:1763:8: note: candidate function not viable: requires 2 arguments, but 1 was provided

[log.txt](https://github.com/tensorflow/tensorflow/files/2203945/log.txt)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 18 (4 by maintainers)

Most upvoted comments

@davlhd Thankyou! I changed the flatbuffers version to v1.8.0 and it works. In my case, the error @davlhd mentioned pop up for x86_64 architecture( i386 I didn’t try) . If I build only for arm64 architecture (which I need), I can build with no more issues.

Here is my modification.

  1. change download_dependencies.sh ( line 38, FLATBUFFERS_URL=…/master.zip" -> …/v1.8.0.zip")
  2. comment out and get rid of any other architectures except arm64 architecture.

Change from

FLATBUFFERS_URL="https://github.com/google/flatbuffers/archive/master.zip"
to 
FLATBUFFERS_URL="https://github.com/google/flatbuffers/archive/v1.8.0.zip"

indownload_dependencies.sh

I tried replacing the downloaded version of flatbuffers with an older one and it worked (1.8.0)