Mediapipe: Tensorflow not compiling with Bazel build

Created on 20 Aug 2019  路  11Comments  路  Source: google/mediapipe

Hello,

I'm trying to compile to hand tracking app, but having lots of issues.

I believe when trying to compile the Tensorflow kernel, an error is being raised.

DEBUG: Rule 'build_bazel_rules_apple' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "6c9fcae7a3597aabd43f28be89466afe0eab18de", shallow_since = "1565379803 -0700" and dropping ["tag"]
DEBUG: Call stack for the definition of repository 'build_bazel_rules_apple' which is a git_repository (rule definition at /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/bazel_tools/tools/build_defs/repo/git.bzl:181:18):

  • /Users/willbishop/Developer/mediapipe/WORKSPACE:251:1
    INFO: Call stack for the definition of repository 'local_config_git' which is a git_configure (rule definition at /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/third_party/git/git_configure.bzl:66:17):
  • /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/tensorflow/workspace.bzl:73:5
  • /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/tensorflow/workspace.bzl:60:5
  • /Users/willbishop/Developer/mediapipe/WORKSPACE:121:1
    ERROR: An error occurred during the fetch of repository 'local_config_git':
    Not a regular file: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/.git/HEAD
    INFO: Call stack for the definition of repository 'eigen_archive' which is a tf_http_archive (rule definition at /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/third_party/repo.bzl:124:19):
  • /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/tensorflow/workspace.bzl:170:5
  • /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/tensorflow/workspace.bzl:60:5
  • /Users/willbishop/Developer/mediapipe/WORKSPACE:121:1
    ERROR: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/tensorflow/core/BUILD:2785:1: @org_tensorflow//tensorflow/core:version_info_gen depends on @local_config_git//:gen/spec.json in repository @local_config_git which failed to fetch. no such package '@local_config_git//': Not a regular file: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/.git/HEAD
    ERROR: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/tensorflow/core/BUILD:2785:1: @org_tensorflow//tensorflow/core:version_info_gen depends on @local_config_git//:gen/head in repository @local_config_git which failed to fetch. no such package '@local_config_git//': Not a regular file: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/.git/HEAD
    ERROR: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/tensorflow/core/BUILD:2785:1: @org_tensorflow//tensorflow/core:version_info_gen depends on @local_config_git//:gen/branch_ref in repository @local_config_git which failed to fetch. no such package '@local_config_git//': Not a regular file: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/.git/HEAD
    ERROR: Analysis of target '//mediapipe/examples/ios/handtrackinggpu:HandTrackingGpuApp' failed; build aborted: no such package '@local_config_git//': Not a regular file: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/.git/HEAD
    INFO: Elapsed time: 0.711s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully (0 packages loaded, 11 targets configured)
    currently loading: @org_tensorflow//tensorflow/core/kernels

Any ideas?

I'm getting lots of

no such package '@local_config_git//': Not a regular file

build question

Most helpful comment

Can you try installing the 'future' pip package by

pip install --upgrade setuptools && pip install future

Does this help?

All 11 comments

Can you try installing the 'future' pip package by

pip install --upgrade setuptools && pip install future

Does this help?

It does not.

willbishop@MacBook-Pro-9 mediapipe % pip install --upgrade setuptools && pip install future

Collecting setuptools
Using cached https://files.pythonhosted.org/packages/75/b3/0a106dfaf7f48aef638da80b32608617cc8de4b24a22c8cd3759c32e5d30/setuptools-41.1.0-py2.py3-none-any.whl
Installing collected packages: setuptools
Found existing installation: setuptools 40.5.0
Uninstalling setuptools-40.5.0:
Successfully uninstalled setuptools-40.5.0
Successfully installed setuptools-41.1.0
Requirement already satisfied: future in /usr/local/lib/python3.7/site-packages (0.17.1)

They were both already installed

What if you comment out one of our TensorFlow patches in the WORKSPACE file and switch back to Python2:

http_archive(
    name = "org_tensorflow",
    urls = [
      "https://mirror.bazel.build/github.com/tensorflow/tensorflow/archive/%s.tar.gz" % _TENSORFLOW_GIT_COMMIT,
      "https://github.com/tensorflow/tensorflow/archive/%s.tar.gz" % _TENSORFLOW_GIT_COMMIT,
    ],
    strip_prefix = "tensorflow-%s" % _TENSORFLOW_GIT_COMMIT,
    sha256 = _TENSORFLOW_SHA256,
    patches = [
        # "@//third_party:tensorflow_065c20bf79253257c87bd4614bb9a7fdef015cbb.diff",
        "@//third_party:tensorflow_f67fcbefce906cd419e4657f0d41e21019b71abd.diff",
    ],
    patch_args = [
        "-p1",
    ],
)

then do

bazel clean --expunge
bazel build -c opt --config=ios_arm64 mediapipe/examples/ios/handdetectiongpu:HandDetectionGpuApp

Do you see anything new?
Moreover, can you report the version number of the OS, Xcode , python and git you use?

No luck unfortunately.

macOS: 10.15 Beta 6
Xcode: 10.2 and 11.0 Beta 6
Python: Multiple installations again, 2.7.16 & 3.7.1
Git: 2..20.1

With Xcode, I did sudo xcode-select /Applications/Xcode.app, so it should be using a non-beta Xcode.

How can I ensure that Bazel is using Python 2 here?

The following was after a clean

willbishop@MacBook-Pro-9 mediapipe % sudo !!
sudo xcode-select -s /Applications/Xcode.app
Password:
willbishop@MacBook-Pro-9 mediapipe % bazel build -c opt --config=ios_arm64 mediapipe/examples/ios/handdetectiongpu:HandDetectionGpuApp

DEBUG: Rule 'build_bazel_rules_apple' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "6c9fcae7a3597aabd43f28be89466afe0eab18de", shallow_since = "1565379803 -0700" and dropping ["tag"]
DEBUG: Call stack for the definition of repository 'build_bazel_rules_apple' which is a git_repository (rule definition at /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/bazel_tools/tools/build_defs/repo/git.bzl:181:18):
 - /Users/willbishop/Developer/mediapipe/WORKSPACE:251:1
INFO: Call stack for the definition of repository 'local_config_git' which is a git_configure (rule definition at /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/third_party/git/git_configure.bzl:63:17):
 - /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/tensorflow/workspace.bzl:73:5
 - /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/tensorflow/workspace.bzl:60:5
 - /Users/willbishop/Developer/mediapipe/WORKSPACE:121:1
ERROR: An error occurred during the fetch of repository 'local_config_git':
   Not a regular file: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/.git/HEAD
INFO: Call stack for the definition of repository 'eigen_archive' which is a tf_http_archive (rule definition at /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/third_party/repo.bzl:124:19):
 - /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/tensorflow/workspace.bzl:170:5
 - /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/tensorflow/workspace.bzl:60:5
 - /Users/willbishop/Developer/mediapipe/WORKSPACE:121:1
ERROR: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/tensorflow/core/BUILD:2785:1: @org_tensorflow//tensorflow/core:version_info_gen depends on @local_config_git//:gen/spec.json in repository @local_config_git which failed to fetch. no such package '@local_config_git//': Not a regular file: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/.git/HEAD
ERROR: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/tensorflow/core/BUILD:2785:1: @org_tensorflow//tensorflow/core:version_info_gen depends on @local_config_git//:gen/head in repository @local_config_git which failed to fetch. no such package '@local_config_git//': Not a regular file: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/.git/HEAD
ERROR: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/tensorflow/core/BUILD:2785:1: @org_tensorflow//tensorflow/core:version_info_gen depends on @local_config_git//:gen/branch_ref in repository @local_config_git which failed to fetch. no such package '@local_config_git//': Not a regular file: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/.git/HEAD
ERROR: Analysis of target '//mediapipe/examples/ios/handdetectiongpu:HandDetectionGpuApp' failed; build aborted: no such package '@local_config_git//': Not a regular file: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/.git/HEAD
INFO: Elapsed time: 0.757s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
    currently loading: @org_tensorflow//tensorflow/core/kernels

I tried the Bazel command with a clean Mac but can't reproduce this issue.
The issue might beyond MediaPipe's scope. We will be reaching out to the TensorFlow team to look into this issue together. Please allow us some time.

ERROR: An error occurred during the fetch of repository 'local_config_git':
Not a regular file: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/.git/HEAD

What's going on with this file? Try ls -l /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/.git/HEAD.
Does blaze clean get rid of the directory 90c7606163fe10184a478bf135286c77?

willbishop|master:~/Developer/mediapipe/mediapipe$ ls -l /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/.git/HEAD
ls: /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77/external/org_tensorflow/.git/HEAD: No such file or directory

Unfortunately.

willbishop|master:~/Developer/mediapipe/mediapipe$ bazel clean
INFO: Starting clean.
willbishop|master:~/Developer/mediapipe/mediapipe$ ls -l /private/var/tmp/_bazel_willbishop/90c7606163fe10184a478bf135286c77
total 368
-rw-r--r-- 1 willbishop wheel 37 Aug 28 20:42 DO_NOT_BUILD_HERE
-rw-r--r-- 1 willbishop wheel 791 Aug 28 20:42 README
drwxr-xr-x 2 willbishop wheel 64 Aug 20 22:33 bazel-workers
drwxr-xr-x 2 willbishop wheel 64 Aug 28 20:47 execroot
drwxr-xr-x 69 willbishop wheel 2208 Aug 28 20:45 external
lrwxr-xr-x 1 willbishop wheel 67 Aug 20 22:33 install -> /var/tmp/_bazel_willbishop/install/8772b695a4a7b498a4dd3eff54505d9c
lrwxr-xr-x 1 willbishop wheel 63 Aug 28 20:42 java.log -> java.log.macbook-pro-9.willbishop.log.java.20190828-204239.3613
-rw-r--r-- 1 willbishop wheel 36442 Aug 21 01:34 java.log.macbook-pro-9.willbishop.log.java.20190820-223326.10472
-rw-r--r-- 1 willbishop wheel 93235 Aug 28 20:47 java.log.macbook-pro-9.willbishop.log.java.20190828-204239.3613
-rw-r--r-- 1 willbishop wheel 528 Aug 28 20:47 javalog.properties
-rw-r--r-- 1 willbishop wheel 91 Aug 28 20:47 lock
drwxr-xr-x 2 willbishop wheel 64 Aug 28 20:42 sandbox
drwx------ 8 willbishop wheel 256 Aug 28 20:42 server
willbishop|master:~/Developer/mediapipe/mediapipe$

Running that does not get rid of the folder

Could you try deleting the folder manually?

@WillBishop Any updates? pls reopen issue if you do

Repro steps:
1) clone mediapipe
2) rename the folder (!)
3) Open MediaPipe.tulsiproj

You could try to run the ./configure and set path to python3.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dgrnd4 picture dgrnd4  路  4Comments

karfly picture karfly  路  3Comments

7AM7 picture 7AM7  路  5Comments

Rakeshvcr picture Rakeshvcr  路  4Comments

SwatiModi picture SwatiModi  路  5Comments