尝试构建张量流时出错

问题描述:

我目前正在尝试从源构建tensorflow,因为我需要使用C++ API。作为第一条指南,我试图按照源指南安装https://www.tensorflow.org/versions/master/get_started/os_setup。 然而,当我运行:尝试构建张量流时出错

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

我收到以下错误

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 

有没有其他人遇到这个错误,可以给如何解决它的提示?

好的,我自己解决了。 问题是,我用Eclipse克隆了存储库。这似乎导致了一些问题。解决方案:删除文件夹,在终端中用git克隆它,一切正常。