Jendrik
Jendrik

Reputation: 186

Error when trying to build tensorflow

I am currently trying to build tensorflow from source, as I will need to use the C++ API. As a first guideline I tried to follow the installing from source guideline at https://www.tensorflow.org/versions/master/get_started/os_setup. However, when I am running:

bazel build --verbose_failures --config=cuda --config opt //tensorflow/tools/pip_package:build_pip_package

I get the following error

ERROR: /home/jendrik/git/tensorflow/tensorflow/core/BUILD:1308:1: Executing genrule //tensorflow/core:version_info_gen failed: bash failed: error executing command 
  (cd /home/jendrik/.cache/bazel/_bazel_jendrik/3f14545a6ed4968ac3fe30f78c0e868e/execroot/tensorflow && \
  exec env - \
    LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:/usr/local/cuda-8.0/lib: \
    PATH='~/anaconda3/bin:/usr/local/cuda-8.0/bin:home/jendrik/anaconda3/bin:/home/jendrik/bin:/home/jendrik/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin' \
  /bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; tensorflow/tools/git/gen_git_source.py --generate tensorflow/tools/git/gen/spec.json tensorflow/tools/git/gen/head tensorflow/tools/git/gen/branch_ref "bazel-out/local_linux-py3-opt/genfiles/tensorflow/core/util/version_info.cc"'): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Traceback (most recent call last):
  File "tensorflow/tools/git/gen_git_source.py", line 260, in <module>
    generate(args.generate)
  File "tensorflow/tools/git/gen_git_source.py", line 212, in generate
    git_version = get_git_version(data["path"])
  File "tensorflow/tools/git/gen_git_source.py", line 152, in get_git_version
    str("--work-tree=" + git_base_path), "describe", "--long", "--tags"
  File "/usr/lib/python2.7/subprocess.py", line 567, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 16.651s, Critical Path: 15.48s

Did anyone else experienced this error and can give a hint on how to resolve it?

Upvotes: 1

Views: 972

Answers (1)

Jendrik
Jendrik

Reputation: 186

Okay I resolved it on my own. The problem was, that I cloned the repository with Eclipse. This seems to cause some issue. Solution: Delete folder, clone it with git in terminal and everything works.

Upvotes: 1

Related Questions