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

Wasn't able to get it to work: Pi Zero image available? #3

Closed
Tylersuard opened this issue Jul 29, 2019 · 14 comments
Closed

Wasn't able to get it to work: Pi Zero image available? #3

Tylersuard opened this issue Jul 29, 2019 · 14 comments

Comments

@Tylersuard
Copy link

Hello. I wasn't able to get this to work. Do you have an image of a Pi Zero I can download and use instead? Thank you!

Ps, here is my error message:

  • cd /home/tdoggo/tensorflow/tensorflow/lite/tools/make/../../../..
  • CC_PREFIX=arm-linux-gnueabihf-
  • make -j 3 -f tensorflow/lite/tools/make/Makefile TARGET=rpi TARGET_ARCH=armv6
    arm-linux-gnueabihf-g++ -O3 -DNDEBUG -fPIC --std=c++11 -march=armv6 -mfpu=vfp -funsafe-math-optimizations -ftree-vectorize -fPIC -I. -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/../../../../../ -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/../../../../../../ -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/ -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/eigen -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/absl -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/gemmlowp -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/neon_2_sse -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/farmhash/src -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/flatbuffers/include -I -I/usr/local/include -c tensorflow/lite/arena_planner.cc -o /home/tdoggo/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/obj/tensorflow/lite/arena_planner.o
    arm-linux-gnueabihf-gcc -O3 -DNDEBUG -fPIC -I. -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/../../../../../ -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/../../../../../../ -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/ -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/eigen -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/absl -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/gemmlowp -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/neon_2_sse -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/farmhash/src -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/flatbuffers/include -I -I/usr/local/include -c tensorflow/lite/c/c_api_internal.c -o /home/tdoggo/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/obj/tensorflow/lite/c/c_api_internal.o
    arm-linux-gnueabihf-g++ -O3 -DNDEBUG -fPIC --std=c++11 -march=armv6 -mfpu=vfp -funsafe-math-optimizations -ftree-vectorize -fPIC -I. -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/../../../../../ -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/../../../../../../ -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/ -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/eigen -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/absl -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/gemmlowp -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/neon_2_sse -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/farmhash/src -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/flatbuffers/include -I -I/usr/local/include -c tensorflow/lite/allocation.cc -o /home/tdoggo/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/obj/tensorflow/lite/allocation.o
    arm-linux-gnueabihf-g++ -O3 -DNDEBUG -fPIC --std=c++11 -march=armv6 -mfpu=vfp -funsafe-math-optimizations -ftree-vectorize -fPIC -I. -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/../../../../../ -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/../../../../../../ -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/ -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/eigen -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/absl -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/gemmlowp -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/neon_2_sse -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/farmhash/src -I/home/tdoggo/tensorflow/tensorflow/lite/tools/make/downloads/flatbuffers/include -I -I/usr/local/include -c tensorflow/lite/core/api/error_reporter.cc -o /home/tdoggo/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/obj/tensorflow/lite/core/api/error_reporter.o
    In file included from tensorflow/lite/core/api/error_reporter.cc:15:0:
    ./tensorflow/lite/core/api/error_reporter.h: In destructor ‘virtual tflite::ErrorReporter::~ErrorReporter()’:
    ./tensorflow/lite/core/api/error_reporter.h:37:28: sorry, unimplemented: Thumb-1 hard-float VFP ABI
    virtual ~ErrorReporter() {}
    ^
    In file included from /usr/arm-linux-gnueabihf/include/c++/5/bits/stl_algobase.h:62:0,
    from /usr/arm-linux-gnueabihf/include/c++/5/memory:62,
    from ./tensorflow/lite/arena_planner.h:18,
    from tensorflow/lite/arena_planner.cc:15:
    /usr/arm-linux-gnueabihf/include/c++/5/ext/type_traits.h: In function ‘bool __gnu_cxx::__is_null_pointer(std::nullptr_t)’:
    /usr/arm-linux-gnueabihf/include/c++/5/ext/type_traits.h:160:35: sorry, unimplemented: Thumb-1 hard-float VFP ABI
    __is_null_pointer(std::nullptr_t)
    ^
    tensorflow/lite/tools/make/Makefile:216: recipe for target '/home/tdoggo/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/obj/tensorflow/lite/core/api/error_reporter.o' failed
    make: *** [/home/tdoggo/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/obj/tensorflow/lite/core/api/error_reporter.o] Error 1
    make: *** Waiting for unfinished jobs....
    In file included from /usr/arm-linux-gnueabihf/include/stdio.h:933:0,
    from /usr/arm-linux-gnueabihf/include/c++/5/cstdio:42,
    from ./tensorflow/lite/allocation.h:20,
    from tensorflow/lite/allocation.cc:16:
    /usr/arm-linux-gnueabihf/include/bits/stdio.h: In function ‘int getchar()’:
    /usr/arm-linux-gnueabihf/include/bits/stdio.h:44:14: sorry, unimplemented: Thumb-1 hard-float VFP ABI
    getchar (void)
    ^
    tensorflow/lite/tools/make/Makefile:216: recipe for target '/home/tdoggo/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/obj/tensorflow/lite/allocation.o' failed
    make: *** [/home/tdoggo/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/obj/tensorflow/lite/allocation.o] Error 1
    tensorflow/lite/tools/make/Makefile:216: recipe for target '/home/tdoggo/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/obj/tensorflow/lite/arena_planner.o' failed
    make: *** [/home/tdoggo/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/obj/tensorflow/lite/arena_planner.o] Error 1
@rushil791
Copy link

Hi Tyler,

I had a similar issue. I found that reverting back to a specific version of Tensorflow Lite (1.13.1 worked for me) fixed all issues and the Makefile worked as expected.

Let me know if you still have issues, I've misplaced my SD card but I have documented all the steps I took so I'm happy to send them over.

@Tylersuard
Copy link
Author

Tylersuard commented Jul 30, 2019

I would appreciate knowing the steps! I'm having a hard time finding Tflow 1.13.1 Thank you!

@cloudwiser
Copy link
Owner

cloudwiser commented Aug 18, 2019

Apologies for the slow response folks - not getting GH notifications for some reason.
Let me know if you are still blocked and I'll investigate - I may have missed some obvious steps and/or the dependencies have changed...

@ONLYstcm
Copy link

ONLYstcm commented Nov 9, 2019

I seem to have a similar problem. I get the following error when I try to complete the compilation:

collect2: error: ld returned 1 exit status
make: *** [tensorflow/lite/tools/make/Makefile:316: /home/pi/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/bin/label_image] Error 1

'benchmark' executable is in the bin folder but 'minimal' and 'label_image' are missing. 'libtensorflow-lite.a' and 'benchmark-lib.a' are in the lib folder.

@ONLYstcm
Copy link

ONLYstcm commented Nov 9, 2019

Just downloaded Tensorflow v1.13.1. When I try to compile I get the following error:

make: *** No rule to make target '/home/pi/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/obj/tensorflow/lite/experimental/ruy/allocator.o', needed by '/home/pi/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/lib/libtensorflow-lite.a'. Stop.

@cloudwiser
Copy link
Owner

cloudwiser commented Nov 9, 2019

Just to confirm - these errors were the output of ./tensorflow/lite/tools/make/build_rpi_armv6_lib.sh running against TF 1.13.1 on Pi Zero W?

@ONLYstcm
Copy link

ONLYstcm commented Nov 9, 2019

Yes. I used the script: ./tensorflow/lite/tools/make/build_rpi_armv6_lib.sh, I actually tried compiling again with TF 1.13.1 and an older Makefile model (the one from 13 March) and it compiled for a longer time but eventually got the follwing error

collect2: error: ld returned 1 exit status
make: *** [tensorflow/lite/tools/make/Makefile:252: /home/pi/tensorflow-1.13.1/tensorflow/lite/tools/make/gen/rpi_armv6/bin/benchmark_model] Error 1

'libtensorflow-lite.a' and 'benchmark-lib.a' are present in the lib folder.

@cloudwiser
Copy link
Owner

collect2: error: ld returned 1 exit status

This is usually the consequence of previous errors so you'd need to look earlier in the build process to see if other dependencies are missing/failing.
Unfortunately I'm running TF 1.14.1 but is this on a clean install of TF 1.13.1 on the Pi Zero?

@ONLYstcm
Copy link

ONLYstcm commented Nov 9, 2019

Yes, this was a clean install of TF 1.13.1. There were alot of undefined reference messages to files starting with `_atomic'. However, I can try compiling with TF 1.14.1 and see if there's any success. Is this the recommended Makefile for TF 1.14.1?

@cloudwiser
Copy link
Owner

Yes - this was the original makefile in TF 1.14.1 but only builds the lib, minimal and benchmark.
You would still need build_rpi_armv6_lib.sh or its command line flags to set the target and target arch for rpi and armv6 if you are building on a RPi Zero W
I'll try a clean build on 1.14.1 tomorrow and double check

@cloudwiser
Copy link
Owner

OK - after a make clean, I have re-run .../build_rpi_armv6_lib.sh with the repo Makefile overnight and I have benchmark.lib and libtensorflow-lite.a in /home/pi/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/lib and label_image, benchmark-model and minimal binaries in /home/pi/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/bin. Note you need to stop, change swap space size and start the swapfile service as per the README.mdfor this to complete without errors.
Having checked the RELEASE.mdin tensorflow root directory, I'm running 1.14.0...so I'll check to see if the incremental changes to 1.14.1 may have impacted the build process

@ONLYstcm
Copy link

Swap space is at 2GB, double checked with htop. I've just downloaded 1.14.0 source file from the tensorflow library and very early during compilation (with Makefile and Makefile 1.14.0) I get the following error:

In file included from ./tensorflow/lite/core/api/op_resolver.h:20,
from ./tensorflow/lite/core/api/flatbuffer_conversions.h:24,
from tensorflow/lite/core/api/flatbuffer_conversions.cc:16:
./tensorflow/lite/schema/schema_generated.h:21:10: fatal error: flatbuffers/flatbuffers.h: No such file or directory
#include "flatbuffers/flatbuffers.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [tensorflow/lite/tools/make/Makefile:266: /home/pi/tensorflow-1.14.0/tensorflow/lite/tools/make/gen/rpi_armv6/obj/tensorflow/lite/core/api/flatbuffer_conversions.o] Error 1

If it means anything I'm running 4.19.79+ kernel

@cloudwiser
Copy link
Owner

That sounds like a fundamental TF Lite build issue - it might be worth a search here or on StackOverflow in case others have reported the same.
Anyway, I'll zip my TF 1.14.0 root folder from my RPi Zero W and host either here or on a G-Drive to hopefully unblock anyone with this or other TF-Lite-on-armv6 build issues

@cloudwiser
Copy link
Owner

cloudwiser commented Nov 10, 2019

I have shared a zip of my Tensorflow 1.14.0 folders installed at /home/pi/<tensorflow_unzip_goes_here>/... on my RPi Zero W

This also includes the binaries, model files and sample input images as described in the ObjectDetectionRPiZero repo on GH.

Hope this helps.

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

4 participants