我正在尝试按照 => 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
最佳答案
ERROR: Invalid options syntax: -//tensorflow:libtensorflow_cc.so
I have no idea what this means
字面意思就是它所说的:您使用了无效的选项语法。
事实证明,您稍微误读了说明。命令格式为:
.\build.ps1 -BazelBuildParameters <parameter_string> [optional_parameters]
您删除了文本“BazelBuildParameters”,所以您改为这样做:
.\build.ps1 -<parameter_string> [optional_parameters]
而且计算机不知道如何处理它。
我想你想要这样的东西:
.\build.ps1 -BazelBuildParameters //tensorflow:libtensorflow_cc.so -BuildCppAPI
关于c++ - 错误 : Invalid options syntax: -//tensorflow:libtensorflow_cc. 所以,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57203607/