如何通过命令提示符代码或其他一些 Tensorflow 安装方式找到我系统中当前的 Bazel 版本

How to find the Bazel version currently in my system via command prompt code or some other ways for Tensorflow installation

在Tensorflow的官方网站(https://www.tensorflow.org/install/source_windows)中指定了每个版本的Tensorflow所需的构建工具bazel版本。

如何检查我的 windows 10 系统中的 bazel 版本是否正确(在开始安装 bazel 之前)?

在我的系统中设置 Tensorflow 时,我什至需要担心这个吗?

如果您查看 TensorFlow 根目录中的文件 .bazelversion,它会告诉您推荐的 Bazel 版本。

Windows 的预构建 TensorFlow pip 包适用于大多数用途,除非您打算直接修改 TensorFlow。为此,您不需要 Bazel。

运行:

bazel --version

会告诉您系统上安装了哪个版本的 bazel(并在搜索 PATH 中)。

为了确保全面使用正确/一致的 bazel 版本,在当前目录或其父目录中使用 bazelisk as a front to bazel which also honors the .bazelversion 文件可能会有所帮助(如果存在,因为它在 tensorflow 树中;通常会在 bazel 工作区内转换为)并运行(如果需要下载)相应的 bazel。