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

Tensorflow not compiling with Bazel build #25

Closed
WillBishop opened this issue Aug 20, 2019 · 11 comments
Closed

Tensorflow not compiling with Bazel build #25

WillBishop opened this issue Aug 20, 2019 · 11 comments
Assignees
Labels
type:build/install For Build and Installation issues type:support General questions

Comments

@WillBishop
Copy link

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

@jiuqiant
Copy link
Contributor

Can you try installing the 'future' pip package by

pip install --upgrade setuptools && pip install future

Does this help?

@WillBishop
Copy link
Author

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

@jiuqiant
Copy link
Contributor

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?

@WillBishop
Copy link
Author

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

@jiuqiant
Copy link
Contributor

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.

@camillol camillol added the type:build/install For Build and Installation issues label Aug 27, 2019
@camillol
Copy link
Contributor

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?

@camillol camillol added the type:support General questions label Aug 27, 2019
@WillBishop
Copy link
Author

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

@camillol
Copy link
Contributor

camillol commented Sep 10, 2019

Could you try deleting the folder manually?

@mgyong
Copy link

mgyong commented Sep 16, 2019

@WillBishop Any updates? pls reopen issue if you do

@mgyong mgyong closed this as completed Sep 16, 2019
@NikolayChirkov
Copy link
Contributor

Repro steps:

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

@ConsoleYan
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:build/install For Build and Installation issues type:support General questions
Projects
None yet
Development

No branches or pull requests

6 participants