错误从源头与Bazel构建TensorFlow

发布于 2025-02-02 03:49:15 字数 5701 浏览 1 评论 0原文

我正在尝试将我的SSD Mobilenet图形文件转换为tflite格式,但是我会从源构建TensorFlow的很多错误(im proff of proust this 教程)。

TensorFlow版本为1.13

Bazel版本为0.21.0-(@non-Git)

OS是Win10

这是我的配置,

(src) C:\tensorflow-build\tensorflow>python ./configure.py
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:
nul
WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
INFO: Invocation ID: e7444880-8c68-4c42-9062-ca33135fde40
You have bazel 0.21.0- (@non-git) installed.
Please specify the location of python. [Default is C:\Users\rilmts\anaconda3\envs\src\python.exe]:


Found possible Python library paths:
 C:\Users\rilmts\anaconda3\envs\src\lib\site-packages
Please input the desired Python library path to use.  Default is [C:\Users\rilmts\anaconda3\envs\src\lib\site-packages]

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

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

Do you wish to build TensorFlow with CUDA support? [y/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]: y
Eigen strong inline overridden.

我在这里使用的命令

bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package

错误

(src) C:\tensorflow-build\tensorflow>bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
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:\tensorflow-build\tensorflow/.bazelrc
Starting local Bazel server and connecting to it...
WARNING: Option 'experimental_shortened_obj_file_path' is deprecated
INFO: Invocation ID: 5c1a8d72-71bb-4621-8a24-2052ffcdc30d
ERROR: C:/tensorflow-build/tensorflow/tensorflow/python/tools/api/generator/BUILD:38:1: In rule 'create_python_api_test', size 'medium' is not a valid size.
ERROR: C:/tensorflow-build/tensorflow/tensorflow/python/tools/api/generator/BUILD:38:1: In rule 'create_python_api_test', timeout 'illegal' is not a valid timeout.
ERROR: C:/tensorflow-build/tensorflow/tensorflow/python/tools/api/generator/BUILD:52:1: In rule 'tensorflow_doc_srcs_test', size 'medium' is not a valid size.
ERROR: C:/tensorflow-build/tensorflow/tensorflow/python/tools/api/generator/BUILD:52:1: In rule 'tensorflow_doc_srcs_test', timeout 'illegal' is not a valid timeout.
ERROR: C:/tensorflow-build/tensorflow/tensorflow/python/tools/api/generator/BUILD:68:1: In rule 'output_init_files_test', size 'medium' is not a valid size.

是我遇到的一百多个“规则”错误的 他们。

这样一来,

ERROR: C:/tensorflow-build/tensorflow/tensorflow/tools/pip_package/BUILD:138:1: Target '//tensorflow/contrib/slim/python/slim/data:data_pip' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:simple_console_for_windows'
ERROR: C:/tensorflow-build/tensorflow/tensorflow/tools/pip_package/BUILD:138:1: Target '//tensorflow/contrib/slim/python/slim/nets:nets_pip' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:simple_console_for_windows'
ERROR: C:/tensorflow-build/tensorflow/tensorflow/tools/pip_package/BUILD:138:1: Target '//tensorflow/contrib/specs:specs' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:simple_console_for_windows'
ERROR: C:/tensorflow-build/tensorflow/tensorflow/tools/pip_package/BUILD:138:1: Target '//tensorflow/contrib/summary:summary_test_util' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:simple_console_for_windows'
ERROR: C:/tensorflow-build/tensorflow/tensorflow/tools/pip_package/BUILD:138:1: Target '//tensorflow/contrib/tensor_forest/hybrid:hybrid_pip' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:simple_console_for_windows'
ERROR: C:/tensorflow-build/tensorflow/tensorflow/tools/pip_package/BUILD:138:1: Target '//tensorflow/contrib/tpu:tpu' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:simple_console_for_windows'
ERROR: C:/tensorflow-build/tensorflow/tensorflow/tools/pip_package/BUILD:138:1: Target '//tensorflow/python:pywrap_tensorflow_import_lib_file' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:simple_console_for_windows'
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: Cannot compute config conditions
INFO: Elapsed time: 5,320s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (63 packages loaded, 47 targets configured)
    currently loading: tensorflow/core/kernels
    Fetching @six_archive; Restarting.

(src) C:\tensorflow-build\tensorflow>

我尝试使用Tensorflow 1.14和Bazel 0.24.1尝试过它,并且出现了类似的错误,但是

ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: Analysis failed

我一直在为此而苦苦挣扎的最后一个错误发生了三天。我尝试研究错误,但找不到任何有用的东西。

I am trying to convert my SSD MobileNet graph file to tflite format but i am getting a lot of errors building Tensorflow from source (im following this tutorial).

Tensorflow version is 1.13

Bazel version is 0.21.0- (@non-git)

OS is Win10

This is my configuration

(src) C:\tensorflow-build\tensorflow>python ./configure.py
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:
nul
WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
INFO: Invocation ID: e7444880-8c68-4c42-9062-ca33135fde40
You have bazel 0.21.0- (@non-git) installed.
Please specify the location of python. [Default is C:\Users\rilmts\anaconda3\envs\src\python.exe]:


Found possible Python library paths:
 C:\Users\rilmts\anaconda3\envs\src\lib\site-packages
Please input the desired Python library path to use.  Default is [C:\Users\rilmts\anaconda3\envs\src\lib\site-packages]

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

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

Do you wish to build TensorFlow with CUDA support? [y/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]: y
Eigen strong inline overridden.

The command i used

bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package

Here are the errors

(src) C:\tensorflow-build\tensorflow>bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
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:\tensorflow-build\tensorflow/.bazelrc
Starting local Bazel server and connecting to it...
WARNING: Option 'experimental_shortened_obj_file_path' is deprecated
INFO: Invocation ID: 5c1a8d72-71bb-4621-8a24-2052ffcdc30d
ERROR: C:/tensorflow-build/tensorflow/tensorflow/python/tools/api/generator/BUILD:38:1: In rule 'create_python_api_test', size 'medium' is not a valid size.
ERROR: C:/tensorflow-build/tensorflow/tensorflow/python/tools/api/generator/BUILD:38:1: In rule 'create_python_api_test', timeout 'illegal' is not a valid timeout.
ERROR: C:/tensorflow-build/tensorflow/tensorflow/python/tools/api/generator/BUILD:52:1: In rule 'tensorflow_doc_srcs_test', size 'medium' is not a valid size.
ERROR: C:/tensorflow-build/tensorflow/tensorflow/python/tools/api/generator/BUILD:52:1: In rule 'tensorflow_doc_srcs_test', timeout 'illegal' is not a valid timeout.
ERROR: C:/tensorflow-build/tensorflow/tensorflow/python/tools/api/generator/BUILD:68:1: In rule 'output_init_files_test', size 'medium' is not a valid size.

I got more than hundred of these "In rule" errors so not going to paste all of them.

And it ends like this

ERROR: C:/tensorflow-build/tensorflow/tensorflow/tools/pip_package/BUILD:138:1: Target '//tensorflow/contrib/slim/python/slim/data:data_pip' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:simple_console_for_windows'
ERROR: C:/tensorflow-build/tensorflow/tensorflow/tools/pip_package/BUILD:138:1: Target '//tensorflow/contrib/slim/python/slim/nets:nets_pip' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:simple_console_for_windows'
ERROR: C:/tensorflow-build/tensorflow/tensorflow/tools/pip_package/BUILD:138:1: Target '//tensorflow/contrib/specs:specs' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:simple_console_for_windows'
ERROR: C:/tensorflow-build/tensorflow/tensorflow/tools/pip_package/BUILD:138:1: Target '//tensorflow/contrib/summary:summary_test_util' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:simple_console_for_windows'
ERROR: C:/tensorflow-build/tensorflow/tensorflow/tools/pip_package/BUILD:138:1: Target '//tensorflow/contrib/tensor_forest/hybrid:hybrid_pip' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:simple_console_for_windows'
ERROR: C:/tensorflow-build/tensorflow/tensorflow/tools/pip_package/BUILD:138:1: Target '//tensorflow/contrib/tpu:tpu' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:simple_console_for_windows'
ERROR: C:/tensorflow-build/tensorflow/tensorflow/tools/pip_package/BUILD:138:1: Target '//tensorflow/python:pywrap_tensorflow_import_lib_file' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:simple_console_for_windows'
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: Cannot compute config conditions
INFO: Elapsed time: 5,320s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (63 packages loaded, 47 targets configured)
    currently loading: tensorflow/core/kernels
    Fetching @six_archive; Restarting.

(src) C:\tensorflow-build\tensorflow>

I've tried it with Tensorflow 1.14 and Bazel 0.24.1 and got similar errors but the last error changes to

ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: Analysis failed

I've been struggling with this for three days now. I tried researching the errors but couldn't find anything useful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

木緿 2025-02-09 03:49:15

您是否尝试过运行./ configure,如上所述在这里/a>

Have you tried running ./configure as mentioned here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文