TensorFlow 中的 Bazel 是什么?我什么时候需要重新构建? [英] What is Bazel in TensorFlow? When do I need to build again?

查看:36
本文介绍了TensorFlow 中的 Bazel 是什么?我什么时候需要重新构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Bazel 的新手.我不确定这件事是如何运作的.在 TF 网站上,有关于创建 pip打包并安装".

I'm new to Bazel. I'm not sure how this thing works. On the TF website, there's this section on "Create the pip package and install".

$ bazel build -c opt //tensorflow/tools/pip_package:build_pip_package

# To build with GPU support: 
$ bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

# The name of the .whl file will depend on your platform. 
$ pip install /tmp/tensorflow_pkg/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

情况如下:

  1. TensorFlow 的主分支上有一个新提交,我将其合并到我的分支中.
  2. 我需要重建轮子并对新轮子进行 pip 安装(如果我错了,请纠正我).
  3. 我先 ./configure,然后是 bazel build,然后是 bazel-bin,然后是 pip install.

这是从 master 正确更新更改的正确方法吗?bazel 构建步骤需要很长时间.

Is this the correct way to properly update changes from master? The bazel build step takes a really long time.

推荐答案

Bazel 是一个构建工具,就像其他构建工具一样像 cmake制作.您列出的步骤是从 master 获取更新的正确方法.第一次构建 TensorFlow 时,构建步骤可能需要很长时间.从 master 更新后的后续构建应该更快,因为 Bazel 就像任何其他构建工具一样,不会重新构建依赖项未修改的目标.

Bazel is a build tool just like other build tools like cmake and make. The steps you listed is the correct way to get updates from master. The build step could take long the first time you build TensorFlow. Later builds, after updates from master, should be faster, as Bazel, just like any other build tool, doesn't re-build targets whose dependencies have not been modified.

这篇关于TensorFlow 中的 Bazel 是什么?我什么时候需要重新构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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