尝试构建 tensorflow 时出错 [英] Error when trying to build tensorflow

查看:61
本文介绍了尝试构建 tensorflow 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试从源代码构建 tensorflow,因为我需要使用 C++ API.作为第一个指南,我尝试遵循 https://www 上的从源代码安装指南.tensorflow.org/versions/master/get_started/os_setup.但是,当我运行时:

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

我收到以下错误

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?

推荐答案

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

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.

这篇关于尝试构建 tensorflow 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆