profile
viewpoint

Ask questionsTFlite compilation failing for tf 2.1.0

<em> I am trying to compile tflite library for x86 machine, I have tried it using the following script https://github.com/sourcecode369/tensorflow-1/blob/master/tensorflow/lite/tools/make/build_lib.sh

before this, I have also installed the required dependencies using https://github.com/sourcecode369/tensorflow-1/blob/master/tensorflow/lite/tools/make/download_dependencies.sh </em>

System information

  • OS Platform and Distribution : Linux Ubuntu 18.04
  • TensorFlow installed from : source
  • TensorFlow version : 2.1.0
  • GCC/Compiler version :7.4.0
  • Bazel version : 2.0.0

Describe the current behavior /home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/obj/tensorflow/lite/tools/benchmark/benchmark_performance_options.o /home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/obj/tensorflow/lite/tools/benchmark/benchmark_utils.o /home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/obj/tensorflow/lite/tools/benchmark/benchmark_params.o /home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/obj/tensorflow/lite/profiling/profile_summarizer.o /home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/obj/tensorflow/core/util/stats_calculator.o /home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/obj/tensorflow/lite/tools/command_line_flags.o /home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/obj/tensorflow/lite/tools/evaluation/utils.o ar: creating /home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/lib/benchmark-lib.a g++ -O3 -DNDEBUG -fPIC --std=c++11 -fPIC -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK -pthread -I. -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/../../../../../ -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/../../../../../../ -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/downloads/ -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/downloads/eigen -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/downloads/absl -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/downloads/gemmlowp -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/downloads/neon_2_sse -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/downloads/farmhash/src -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/downloads/flatbuffers/include -I -I/usr/local/include
-o /home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/bin/benchmark_model /home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/obj/tensorflow/lite/tools/benchmark/benchmark_main.o
/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/lib/benchmark-lib.a -lstdc++ -lpthread -lm -lz -ldl g++ -O3 -DNDEBUG -fPIC --std=c++11 -fPIC -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK -pthread -I. -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/../../../../../ -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/../../../../../../ -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/downloads/ -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/downloads/eigen -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/downloads/absl -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/downloads/gemmlowp -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/downloads/neon_2_sse -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/downloads/farmhash/src -I/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/downloads/flatbuffers/include -I -I/usr/local/include
-o /home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/bin/benchmark_model_performance_options /home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/obj/tensorflow/lite/tools/benchmark/benchmark_tflite_performance_options_main.o
/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/lib/benchmark-lib.a -lstdc++ -lpthread -lm -lz -ldl /home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/lib/benchmark-lib.a(command_line_flags.o): In function tflite::Flags::Parse(int*, char const**, std::vector<tflite::Flag, std::allocator<tflite::Flag> > const&)': command_line_flags.cc:(.text+0x57c2): undefined reference totensorflow::internal::LogMessage::LogMessage(char const*, int, int)' command_line_flags.cc:(.text+0x57ed): undefined reference to tensorflow::internal::LogMessage::~LogMessage()' command_line_flags.cc:(.text+0x5997): undefined reference totensorflow::internal::LogMessage::LogMessage(char const*, int, int)' command_line_flags.cc:(.text+0x59c8): undefined reference to tensorflow::internal::LogMessage::~LogMessage()' command_line_flags.cc:(.text+0x5b1d): undefined reference totensorflow::internal::LogMessage::LogMessage(char const*, int, int)' command_line_flags.cc:(.text+0x5b48): undefined reference to tensorflow::internal::LogMessage::~LogMessage()' command_line_flags.cc:(.text+0x5db0): undefined reference totensorflow::internal::LogMessage::LogMessage(char const*, int, int)' command_line_flags.cc:(.text+0x5e24): undefined reference to tensorflow::internal::LogMessage::~LogMessage()' command_line_flags.cc:(.text+0x5ea5): undefined reference totensorflow::internal::LogMessage::~LogMessage()' collect2: error: ld returned 1 exit status tensorflow/lite/tools/make/Makefile:295: recipe for target '/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/bin/benchmark_model' failed make: *** [/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/bin/benchmark_model] Error 1 make: *** Waiting for unfinished jobs.... /home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/lib/benchmark-lib.a(command_line_flags.o): In function tflite::Flags::Parse(int*, char const**, std::vector<tflite::Flag, std::allocator<tflite::Flag> > const&)': command_line_flags.cc:(.text+0x57c2): undefined reference totensorflow::internal::LogMessage::LogMessage(char const*, int, int)' command_line_flags.cc:(.text+0x57ed): undefined reference to tensorflow::internal::LogMessage::~LogMessage()' command_line_flags.cc:(.text+0x5997): undefined reference totensorflow::internal::LogMessage::LogMessage(char const*, int, int)' command_line_flags.cc:(.text+0x59c8): undefined reference to tensorflow::internal::LogMessage::~LogMessage()' command_line_flags.cc:(.text+0x5b1d): undefined reference totensorflow::internal::LogMessage::LogMessage(char const*, int, int)' command_line_flags.cc:(.text+0x5b48): undefined reference to tensorflow::internal::LogMessage::~LogMessage()' command_line_flags.cc:(.text+0x5db0): undefined reference totensorflow::internal::LogMessage::LogMessage(char const*, int, int)' command_line_flags.cc:(.text+0x5e24): undefined reference to tensorflow::internal::LogMessage::~LogMessage()' command_line_flags.cc:(.text+0x5ea5): undefined reference totensorflow::internal::LogMessage::~LogMessage()' collect2: error: ld returned 1 exit status tensorflow/lite/tools/make/Makefile:301: recipe for target '/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/bin/benchmark_model_performance_options' failed make: *** [/home/swati/git_workspace/tensorflow/tensorflow/lite/tools/make/gen/linux_x86_64/bin/benchmark_model_performance_options] Error 1 make: Leaving directory '/home/swati/git_workspace/tensorflow'

Describe the expected behavior It should successfully compile and build the library

Code to reproduce the issue git clone https://github.com/tensorflow/tensorflow cd tensorflow ./tensorflow/lite/tools/download_dependencies.sh ./tensorflow/lite/tools/make/build_lib.sh

I am new to source compilation, currently unable to understand why this is not working.

tensorflow/tensorflow

Answer questions aselle

This was a regression. Fixed in master with this commit. https://github.com/tensorflow/tensorflow/commit/35095ee07fd63b4722d2b87b4de928c89c5a4845

useful!

Related questions

Error occurred when finalizing GeneratorDataset iterator
ModuleNotFoundError: No module named 'tensorflow.contrib'
ModuleNotFoundError: No module named 'tensorflow.contrib' hot 4
When importing TensorFlow, error loading Hadoop hot 4
The flag 'log_dir' is defined twice. hot 3
[TF 2.0] Dataset has no attribute 'make_one_shot_iterator' hot 3
Lossy conversion from float32 to uint8. Range [0, 1]. Convert image to uint8 prior to saving to suppress this warning. hot 3
TF2.0 AutoGraph issue hot 3
Error loading tensorflow hot 3
AttributeError: module 'tensorflow' has no attribute 'set_random_seed' hot 3
No tf.lite.experimental.nn.bidirectional_dynamic_rnn ops is finded hot 3
Incorrect Error TypeError: padded_batch() missing 1 required positional argument: &#39;padded_shapes&#39; hot 3
tensorflow2.0 detected 'xla_gpu' , but 'gpu' expected hot 2
Using tensorflow gpu 2.1 with Cuda 10.2 hot 2
Restoring Keras model fails inside a distribution strategy scope hot 2
Github User Rank List