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

Bazel native build not working for multiple older versions of TF. Python dependency and commit hash issues. #65

Open
ClayJay3 opened this issue Mar 22, 2024 · 6 comments
Labels
Hardware:M.2 Accelerator with dual Edge TPU Coral M.2 Accelerator with Dual Edge TPU issues Hardware:USB Accelerator Coral USB Accelerator issues subtype:ubuntu/linux Ubuntu/Linux Build/installation issues type:build/install Build and install issues

Comments

@ClayJay3
Copy link

ClayJay3 commented Mar 22, 2024

Description

Some of the recent changes being merged have broken bazel builds using the Makefile for some of the older versions of Tensorflow. I am currently attempting to build libedgetpu for TF 2.13.1 and I am using Bazel 5.3.0.

It seems that the commit hash is not getting set in the bazel build command ran by the Makefile. The command shown here is missing a commit on the embed_label argument:
bazel build --stripopt=-x --compilation_mode=opt --cpu=k8 --embed_label='TENSORFLOW_COMMIT=' --stamp //tflite/public:libedgetpu_direct_all.so.stripped

The only modification I made to the workspace.bzl file was commenting out the TF 2.16.1 commit hashes and uncommenting TF 2.13.1 commit hashes.

Bazel also seems to be unable to pull the python toolchain for tensorflow, not sure why (maybe because the commit is missing). This is printed out in multiple places during the build:
ERROR: error loading package '': Label '@org_tensorflow//tensorflow/tools/toolchains/python:python_repo.bzl' is invalid because 'tensorflow/tools/toolchains/python' is not a package; perhaps you meant to put the colon here: '@org_tensorflow//tensorflow/tools/toolchains:python/python_repo.bzl'?

Checking out a82c669 before the toolchains were updated fixes both the python issue and commit not being set in the bazel build command. I am also able to fully build libedgetpu for TF 2.13.1 when checked out to this commit.

Click to expand!

Issue Type

Build/Install

Operating System

Linux, Ubuntu

Coral Device

USB Accelerator, M.2 Accelerator with dual Edge TPU

Other Devices

No response

Programming Language

C++

Relevant Log Output

Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
ERROR: error loading package '': Label '@org_tensorflow//tensorflow/tools/toolchains/python:python_repo.bzl' is invalid because 'tensorflow/tools/toolchains/python' is not a package; perhaps you meant to put the colon here: '@org_tensorflow//tensorflow/tools/toolchains:python/python_repo.bzl'?
Loading: 0 packages loaded
Loading: 0 packages loaded
bazel build --stripopt=-x --compilation_mode=opt --cpu=k8 --embed_label='TENSORFLOW_COMMIT=' --stamp //tflite/public:libedgetpu_direct_all.so.stripped
Another command holds the client lock: 
pid=5283
owner=client
cwd=/tmp/libedgetpu
tty=/dev/pts/1

Waiting for it to complete...
ERROR: error loading package '': Label '@org_tensorflow//tensorflow/tools/toolchains/python:python_repo.bzl' is invalid because 'tensorflow/tools/toolchains/python' is not a package; perhaps you meant to put the colon here: '@org_tensorflow//tensorflow/tools/toolchains:python/python_repo.bzl'?
INFO: Elapsed time: 0.037s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
Loading: 0 packages loaded
ERROR: error loading package '': Label '@org_tensorflow//tensorflow/tools/toolchains/python:python_repo.bzl' is invalid because 'tensorflow/tools/toolchains/python' is not a package; perhaps you meant to put the colon here: '@org_tensorflow//tensorflow/tools/toolchains:python/python_repo.bzl'?
Loading: 0 packages loaded
Loading: 0 packages loaded
make: *** [Makefile:99: libedgetpu-direct] Error 1
@google-coral-bot google-coral-bot bot added Hardware:M.2 Accelerator with dual Edge TPU Coral M.2 Accelerator with Dual Edge TPU issues Hardware:USB Accelerator Coral USB Accelerator issues subtype:ubuntu/linux Ubuntu/Linux Build/installation issues type:build/install Build and install issues labels Mar 22, 2024
@ClayJay3 ClayJay3 changed the title Bazel native build not working for multiple older version of TF. Python dependency and commit hash issues. Bazel native build not working for multiple older versions of TF. Python dependency and commit hash issues. Mar 22, 2024
@ClayJay3
Copy link
Author

ClayJay3 commented Apr 1, 2024

Bump, push

1 similar comment
@ClayJay3
Copy link
Author

ClayJay3 commented Apr 5, 2024

Bump, push

@ClayJay3
Copy link
Author

ClayJay3 commented Apr 5, 2024

I'm just going to use docker I guess.

@SeunghyunOh-Cochl
Copy link

SeunghyunOh-Cochl commented Jul 3, 2024

Hello! I got a same issue when I use v2.5.0 tensorflow. Do you resolve this issue?

@ClayJay3
Copy link
Author

ClayJay3 commented Jul 3, 2024

No, it seems development had generally stopped and support for make builds isn't great. I find the using the docker environment to compile from source works for most versions.

Even if you get the makefile build to finish, it's not guaranteed to work. I had to change versions and then build and export with docker to get a working edgetpu library.

@feranick
Copy link
Contributor

feranick commented Jul 16, 2024

Try again, there have been several updates to fix the exact issues you are having. The current libesdgetpu builds against TF 2.16.1 successfully (using Bazel 6.5) on Linux and MacOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hardware:M.2 Accelerator with dual Edge TPU Coral M.2 Accelerator with Dual Edge TPU issues Hardware:USB Accelerator Coral USB Accelerator issues subtype:ubuntu/linux Ubuntu/Linux Build/installation issues type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

3 participants