使用Bazel安装Tensorflow时发生CalledProcessError

时间:2019-06-12 13:09:26

标签: tensorflow raspberry-pi bazel

我正在尝试在Raspberry pi上使用Bazel从源代码安装Tensorflow。我正在遵循here给出的官方文档。完成为Bazel编写的所有步骤后,在Tensorflow目录中运行./configure时,出现以下错误

/home/cvit/bin/bazel: line 88: /home/cvit/.bazel/bin/bazel-real: cannot execute binary file: Exec format error
/home/cvit/bin/bazel: line 88: /home/cvit/.bazel/bin/bazel-real: Success
Traceback (most recent call last):
  File "./configure.py", line 1552, in <module>
    main()
  File "./configure.py", line 1432, in main
    check_bazel_version('0.15.0')
  File "./configure.py", line 450, in check_bazel_version
    curr_version = run_shell(['bazel', '--batch', '--bazelrc=/dev/null', 'version'])
  File "./configure.py", line 141, in run_shell
    output = subprocess.check_output(cmd)
  File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['bazel', '--batch', '--bazelrc=/dev/null', 'version']' returned non-zero exit status 1

我没有在bazel安装中放置用户标记。因此,我认为这可能是bazelrc错误,因此我尝试设置$PATH=$BAZEL/bin,但没有任何反应。

请提出任何建议!

1 个答案:

答案 0 :(得分:4)

可能的问题是安装了不合适的bazel版本。 在tensorflow目录中运行bazel version,看看是否有错误。 如果bazel版本存在问题,请检出.baselversion文件,如果该文件包含apt无法安装的版本,请从https://github.com/bazelbuild/bazel/releases下载安装程序,然后安装,否则使用apt安装。 之后,一切都应该正常工作。