Closed Anirudha-N closed 4 years ago
@Anirudha-N Can you share the output of:
$ dpkg -l | grep edgetpu
@Namburger I am getting following output
Thanks!
@Anirudha-N sorry, quite a few factor to debug here.
The possibility are that you've built an older static tflite library or linked to an older libedgetpu.so
and it became incompatible with the new runtime?
@Anirudha-N and @Namburger , I am also having the same issue. I purged the edgetpu libraries, pulled the latest Tensorflow from Github, built tflite from source, but still no luck :( All C++ examples are able to run tflite graphs but not the edgetpu graphs for some reason. For python, everything works well.
@Anirudha-N @pirazor
I'm certain that this error occurs due to the new libedgtpu.so
runtime not compatible with one of the build deps for minimal. If I'm correct, then setting LD_LIBRARY_PATH
to load run time version 12, it should works. Here I'm attaching the older runtime:
direct.tar.gz
So if you could, maybe try downloading that runtime and do this:
$ tar xvf direct.tar.gz
$ LD_LIBRARY_PATH=direct/armv7a/ ./minimal <args...>
(I'm assuming both RPI are armv7a but switch to aarch64 if you are on a 64 bits OS)
@Namburger @pirazor I tried older runtime you provided i.e direct.tar.gz .But having the same error again and still no Luck.
I am trying to compile minimal.cc as well and I am running into the exact same issue. I tried using the older libedgetpu.so runtime from the link above and it makes no difference ('Unsupported data type in custom op handler' error when calling interpreter->AllocateTensors() inside BuildEdgeTpuInterpreter function in model_utils.cc, followed by a Seg Fault later when calling interpreter->typed_input_tensor
Can we have an update on this problem?
I am building and running on a coral dev board instead of an RPI. The tflite static library I built using these instructions (https://www.tensorflow.org/lite/guide/build_arm64) from the most recent head (commit 41313e71acb3d6d0) of master branch of tensorflow.
Thank you @Namburger for sharing the edgetpu library file. Unfortunately, I also couldn't make it work. I even tried an older rasberry pi built which had the old edgetpu installation. Maybe, the problem is the latest Tflite C++ API, since I used the most recent version of Tensorflow from Github in all of my attempts.
Dear All:
if the OS of RPI is aarch64 64bit, may be you can try the following project: https://github.com/akioolin/edgetpu_demo
this is a C++ based object detection demo using opencv, libedgetpu and libtensorflow-lite, libabsl*.
I think the problem which is the tensorflow's version not correct. please check the https://github.com/google-coral/edgetpu/blob/diploria2/WORKSPACE, TENSORFLOW_COMMIT = "5d0b55dd4a00c74809e5b32217070a26ac6ef823" this version is what I use.
During building this demo, I got very similar error. After using the right version of tensorflow, the problem is gone.
BR, Akio
Hello @akioolin thank you for sharing your repo.I tried tensorflow version suggested by you.No luck but having the same isssue again.I downloaded https://github.com/tensorflow/tensorflow/archive/5d0b55dd4a00c74809e5b32217070a26ac6ef823.tar.gz file and followed instructions given in https://www.tensorflow.org/lite/guide/build_rpi to build tensorflow lite on my rasberry pi 4.
Also,I am trying to compile your code.But can not able to compile it correctly and failing while doing make.I Installed all libraries by using your readme file.Can you give detailed information regarding running your project?.Also If you can tell your machine specifications it will be very helpful.Thank you.
@Anirudha-N
Sorry for no description about my test bed. I use Edge TPU Dev Board to build this demo. The project could pass on dve board.
For RPi, I suggest you can check the os is 64bit or not. if os is 64bit, and then try to install the .so library in /usr/local/lib from edgetpu_demo/lib. .a is static library, no need to install into /usr/local/lib. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib. the next is try to execute edge_demo binary. please note, the edgetpu runtim, libedgetpu.so should be remove and install the one which i put in the edgetpu_demo/lib due to the version of libedgetpu.so.
If you use my build demo, you could skip tensorflow build at first. and focus on the demo code execution problem.
BR, Akio
@akioolin @Anirudha-N FYI: Here is my sample project for Edge TPU in cpp. https://github.com/iwatake2222/EdgeTPU_CPP
I confirmed it worked fine on Windows, Raspberry Pi 4(Raspbian Buster) + USB Accelerator and Coral dev board.
@iwatake2222
This one is a very useful reference.
BR, Akio
Thank you @Namburger @pirazor @akioolin @iwatake2222 .Finally my object detection code is working on my system.
My system information: Raspberry Pi 4,edge TPU USB accelerator
Solution: I downloaded https://github.com/tensorflow/tensorflow/archive/5d0b55dd4a00c74809e5b32217070a26ac6ef823.tar.gz file recommended by @akioolin and followed instructions given in https://www.tensorflow.org/lite/guide/build_rpi to build tensorflow lite on my rasberry pi 4.
After that I Used direct.tar.gz(which consists libedgetpu.so) given by @Namburger .I installed is by using "install.sh" script given in folder "edgetpu_runtime" provided by @iwatake2222. Replaced files in "edgetpu_runtime" with direct.tar.gz files before running "install.sh"
Thank you all :)
Hi All, I just published a new repo with a single cmake file to build the minimal example:
https://github.com/Namburger/edgetpu-minimal-example
This is a once and for all fix for building this minimal example natively, please take note of how the libtensorflow-lite.a
were build from this commit.
Instructions to build and run:
$ git clone https://github.com/Namburger/edgetpu-minimal-example.git && cd edgetpu-minimal-example
$ ./scripts/install_cmake.sh // install cmake if needed
$ ./scripts/make2gbswap.sh // [Optional] increase swap to avoid OOM killer
$ mkdir build && cd build
$ cmake ..
$ make
$ ../out/aarch64/minimal ../test_data/mobilenet_v1_1.0_224_quant_edgetpu.tflite ../test_data/resized_cat.bmp ../test_data/imagenet_labels.txt
------
Class: tabby, tabby cat
Score: 0.046875
------
Class: tiger cat
Score: 0.109375
------
Class: Siamese cat, Siamese
Score: 0.00390625
------
Class: Egyptian cat
Score: 0.804688
------
Class: doormat, welcome mat
Score: 0.0078125
------
Class: radiator
Score: 0.0078125
------
Class: space heater
Score: 0.0117188
This is a very very very good , cool repo.
@akioolin here is another one, thanks to you for the cv example: https://github.com/Namburger/edgetpu-detection-camera
enjoy :)
@akioolin here is another one, thanks to you for the cv example: https://github.com/Namburger/edgetpu-detection-camera
enjoy :)
@Namburger
this project is a very wonderful project. I lover this project!!!!!
BR, Akio
I am trying to run minimal.cc on Raspberry Pi 4.
I installed Tensorflow Lite as mentioned in below guide link: https://www.tensorflow.org/lite/guide/build_rpi
I am getting following error: ERROR: Internal: Unsupported data type in custom op handler: 29354232 ERROR: Node number 0 (edgetpu-custom-op) failed to prepare. Failed to allocate tensors. Segmentation fault