Closed drosseau closed 7 months ago
I got same error too. I think, libedgetpu is suitable for tensorflow 2.5. Try it with tensorflow 2.5. See https://github.com/google-coral/libedgetpu/blob/master/workspace.bzl
$ git clone https://github.com/tensorflow/tensorflow $ cd tensorflow $ git checkout a4dfb8d1a71385bd6d122e4f27f86dcebb96712d -b tf2.5
I found the flowwing,
in libedgetpu/makefile_build/Makefile ... 65 LIBEDGETPU_CSRCS := $(TFROOT)/tensorflow/lite/c/common.c 66 LIBEDGETPU_COBJS := $(call TOBUILDDIR,$(patsubst %.c,%.o,$(LIBEDGETPU_CSRCS)))
But in tensorflow newer verion than 2.5, there is not common.c on $(TFROOT)/tensorflow/lite/c/
edit libedgetpu/makefile_build/Makefile ... 65 #LIBEDGETPU_CSRCS := $(TFROOT)/tensorflow/lite/c/common.c 65 LIBEDGETPU_CSRCS := $(TFROOT)/tensorflow/lite/core/c/common.cc ... 187 #$(LIBEDGETPU_COBJS) : $(BUILDDIR)/%.o: %.c 187 $(LIBEDGETPU_COBJS) : $(BUILDDIR)/%.o: %.cc ...
and try it with tf 2.11.1
Sorry, edit libedgetpu/makefile_build/Makefile does not work. try with tf2.5
Thanks for the ideas, I think you helped me figure out it.
I had to make these changes:
diff --git a/makefile_build/Makefile b/makefile_build/Makefile
index ef7d290..74ec2cb 100644
--- a/makefile_build/Makefile
+++ b/makefile_build/Makefile
@@ -22,7 +22,7 @@ LIBEDGETPU_CFLAGS := \
LIBEDGETPU_CXXFLAGS := \
-fPIC \
-Wall \
- -std=c++14 \
+ -std=c++17 \
-DDARWINN_PORT_DEFAULT
LIBEDGETPU_LDFLAGS := \
@@ -59,10 +59,11 @@ LIBEDGETPU_INCLUDES := \
$(BUILDDIR)/$(BUILDROOT)
LIBEDGETPU_INCLUDES := $(addprefix -I,$(LIBEDGETPU_INCLUDES))
-LIBEDGETPU_CSRCS := $(TFROOT)/tensorflow/lite/c/common.c
+LIBEDGETPU_CSRCS :=
LIBEDGETPU_COBJS := $(call TOBUILDDIR,$(patsubst %.c,%.o,$(LIBEDGETPU_CSRCS)))
LIBEDGETPU_CCSRCS := \
+ $(TFROOT)/tensorflow/lite/c/common.cc \
$(BUILDROOT)/api/allocated_buffer.cc \
$(BUILDROOT)/api/buffer.cc \
$(BUILDROOT)/api/driver_options_helper.cc \
diff --git a/api/allocated_buffer.h b/api/allocated_buffer.h
index 97740f0..7bc0547 100644
--- a/api/allocated_buffer.h
+++ b/api/allocated_buffer.h
@@ -16,6 +16,7 @@
#define DARWINN_API_ALLOCATED_BUFFER_H_
#include <functional>
+#include <cstddef>
namespace platforms {
namespace darwinn {
and then I changed my setup above to:
CODEPATH=/home/user/code/github.com
EDGETPU=$CODEPATH/google-coral/libedgetpu
TFROOT=$CODEPATH/tensorflow/tensorflow
$ git clone https://github.com/google-coral/libedgetpu $EDGETPU
$ git clone https://github.com/tensorflow/tensorflow $TFROOT
$ cd $TFROOT
$ git checkout v2.11.1
$ cd $EDGETPU
$ git checkout release-grouper
# The Makefile seemed to have issues with this being an absolute path
$ ln -s "$TFROOT" tensorflow
$ make SHELL=$(which bash) TFROOT=tensorflow -f makefile_build/Makefile libedgetpu
Description
I'm trying to build this library with the Makefile method, but I can't seem to get it working.
Here is my process:
Sadly I'm not too familiar with debugging Makefiles so I'm not able to fully understand why that error is occuring
Click to expand!
### Issue Type Build/Install ### Operating System Linux ### Coral Device USB Accelerator ### Other Devices _No response_ ### Programming Language _No response_ ### Relevant Log Output _No response_