【问题标题】:ERROR: Invalid options syntax: -//tensorflow:libtensorflow_cc.so错误:无效的选项语法:-//tensorflow:libtensorflow_cc.so
【发布时间】:2019-07-25 13:51:15
【问题描述】:

我正在尝试按照 => this 页面上的说明首次让 TensorFlow 在 C++ 中工作。

在 PowerShell 中我执行了

.\build.ps1 -//tensorflow:libtensorflow_cc.so -BuildCppAPI

但在执行过程中我得到以下信息:

ERROR: Invalid options syntax: -//tensorflow:libtensorflow_cc.so

我不知道这意味着什么——我什至不知道是什么系统打印出错误或什么操作失败了。下面是我在 PowerShell 窗口中看到的最后一部分。

You have bazel 0.20.0 installed.
Do you wish to build TensorFlow with XLA JIT support? [y/N]: n
No XLA JIT support will be enabled for TensorFlow.

Do you wish to build TensorFlow with ROCm support? [y/N]: n
No ROCm support will be enabled for TensorFlow.

Do you wish to build TensorFlow with CUDA support? [y/N]: n
No CUDA support will be enabled for TensorFlow.

Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is /arch:AVX]:


Would you like to override eigen strong inline for some C++ compilation to reduce the compilation time? [Y/n]: n
Not overriding eigen strong inline, some compilations could take more than 20 mins.

Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
        --config=mkl            # Build with MKL support.
        --config=monolithic     # Config for mostly static monolithic build.
        --config=gdr            # Build with GDR support.
        --config=verbs          # Build with libverbs support.
        --config=ngraph         # Build with Intel nGraph support.
        --config=dynamic_kernels        # (Experimental) Build kernels into separate shared objects.
Preconfigured Bazel build configs to DISABLE default on features:
        --config=noaws          # Disable AWS S3 filesystem support.
        --config=nogcp          # Disable GCP support.
        --config=nohdfs         # Disable HDFS support.
        --config=noignite       # Disable Apacha Ignite support.
        --config=nokafka        # Disable Apache Kafka support.
        --config=nonccl         # Disable NVIDIA NCCL support.
WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
c:\tf_windows_build\tensorflow-windows-build-script-master\source/.bazelrc
Starting local Bazel server and connecting to it...
ERROR: Invalid options syntax: -//tensorflow:libtensorflow_cc.so
INFO: Invocation ID: 8f02ecb6-9ff4-429a-841d-500d4246669f
WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
c:\tf_windows_build\tensorflow-windows-build-script-master\source/.bazelrc
INFO: Invocation ID: 5fd16822-1851-41f6-ac48-fdda432096f5

【问题讨论】:

  • 请仔细查看您引用的页面上的示例。该示例没有告诉您运行.\build.ps1 -//tensorflow:libtensorflow_cc.so -BuildCppAPI

标签: c++ windows powershell tensorflow bazel


【解决方案1】:
ERROR: Invalid options syntax: -//tensorflow:libtensorflow_cc.so

我不知道这是什么意思

它的字面意思就是它所说的:你使用了无效的选项语法。

事实证明,您稍微误读了说明。命令格式为:

.\build.ps1 -BazelBuildParameters <parameter_string> [optional_parameters]

您删除了文本“BazelBuildParameters”,因此您改为这样做:

.\build.ps1 -<parameter_string> [optional_parameters]

计算机不知道如何处理它。


我猜你想要这样的东西:

.\build.ps1 -BazelBuildParameters //tensorflow:libtensorflow_cc.so -BuildCppAPI

【讨论】:

  • Spot on.... 我很困惑,因为 build.ps1 做了很多事情(花了很长时间)看起来都正确,所以当错误发生时,我认为它一定是一些深层问题在脚本中,而不是像脚本本身的命令行那样简单。
  • 它确实直接指出了问题所在,甚至引用了命令的不正确部分
猜你喜欢
  • 2018-12-29
  • 2021-08-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-11-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多