2017-03-02 192 views
1

我目前正在嘗試從源構建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 

有沒有其他人遇到這個錯誤,可以給如何解決它的提示?

回答

1

好的,我自己解決了。 問題是,我用Eclipse克隆了存儲庫。這似乎導致了一些問題。解決方案:刪除文件夾,在終端中用git克隆它,一切正常。