TensorFlow:构建pip包时出现bazel错误

TensorFlow:构建pip包时出现bazel错误,tensorflow,bazel,Tensorflow,Bazel,下面是编译TensorFlow库的步骤 使用此代码bazel build-c opt--copt=-mavx--copt=-mavx2--copt=-mfma--copt=-mfpmath=both--copt=-msse4.2--config=cuda-k//tensorflow/tools/pip_-package:build_-pip_-package,但是得到了以下错误 WARNING: Config values are not defined in any .rc file: cud

下面是编译TensorFlow库的步骤

使用此代码
bazel build-c opt--copt=-mavx--copt=-mavx2--copt=-mfma--copt=-mfpmath=both--copt=-msse4.2--config=cuda-k//tensorflow/tools/pip_-package:build_-pip_-package
,但是得到了以下错误

WARNING: Config values are not defined in any .rc file: cuda
ERROR: Skipping '//tensorflow/tools/pip_package:build_pip_package': no such package 'tensorflow/tools/pip_package': BUILD file not found on package path
WARNING: Target pattern parsing failed.
INFO: Analysed 0 targets (0 packages loaded).
INFO: Found 0 targets...
ERROR: command succeeded, but there were errors parsing the target pattern
INFO: Elapsed time: 0.331s, Critical Path: 0.02s
FAILED: Build did NOT complete successfully
这是因为我使用pip安装了TensorFlow吗


有什么问题吗?

您必须运行
/configure
。这将在Tensorflow工作区中创建一个
.bazelrc
.tf\u configure.bazel
文件

--config=cuda
Bazel标志引用这两个文件中的条目(它们都是文本文件)。条目通常如下所示:
build:cuda——some_bazel_flag