Stderr:java.io.IOException:错误:构建TensorFlow 2.4.0 CPU版本Windows 10 / arch:AVX2

问题描述

我正在尝试为AVX2体系结构构建TensorFlow 2.4.0 CPU版本。我正在按照this指南进行操作。

我成功配置了python configure.py的编译设置,但现在停留在bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package

哪个抛出错误:

Non-zero return code(256) when executing ' c:\msys64\usr\bin\bash.exe -l -c "rm" "-rf" "C:/users/sayan/_bazel_sayan/xp7m463y/external/flatbuffers/build_defs.bzl"':
Stdout:
Stderr: java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("C:\users\sayan\_bazel_sayan\xp7m463y\external\flatbuffers\ c:\msys64\usr\bin\bash.exe" -l -c "\"rm\" \"-rf\" \"C:/users/sayan/_bazel_sayan/xp7m463y/external/flatbuffers/build_defs.bzl\""): The system cannot find the file specified.
 (error: 2)
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: Analysis failed
INFO: Elapsed time: 15.662s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded,14 targets configured)
    currently loading: tensorflow/lite/python

详细的错误消息:

(tf2) C:\Users\Sayan\Downloads\tensorflow>bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
WARNING: Ignoring JAVA_HOME,because it must point to a JDK,not a JRE.
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=120
INFO: Reading rc options for 'build' from c:\users\sayan\downloads\tensorflow\.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Options provided by the client:
  'build' options: --python_path=C:/Users/Sayan/AppData/Local/Programs/Python/Python38-32/python.exe
INFO: Reading rc options for 'build' from c:\users\sayan\downloads\tensorflow\.bazelrc:
  'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --java_toolchain=//third_party/toolchains/java:tf_java_toolchain --host_java_toolchain=//third_party/toolchains/java:tf_java_toolchain --define=tensorflow_enable_mlir_generated_gpu_kernels=0 --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --noincompatible_prohibit_aapt1 --enable_platform_specific_config --config=short_logs --config=v2
INFO: Reading rc options for 'build' from c:\users\sayan\downloads\tensorflow\.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=C:/Users/Sayan/anaconda3/python.exe --action_env PYTHON_LIB_PATH=C:/Users/Sayan/anaconda3/lib/site-packages --python_path=C:/Users/Sayan/anaconda3/python.exe --config=xla --define=override_eigen_strong_inline=true --action_env TF_CONFIGURE_IOS=0
INFO: Found applicable config definition build:short_logs in file c:\users\sayan\downloads\tensorflow\.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file c:\users\sayan\downloads\tensorflow\.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:xla in file c:\users\sayan\downloads\tensorflow\.bazelrc: --define=with_xla_support=true
INFO: Found applicable config definition build:opt in file c:\users\sayan\downloads\tensorflow\.tf_configure.bazelrc: --copt=/arch:AVX2 --define with_default_optimizations=true
INFO: Found applicable config definition build:windows in file c:\users\sayan\downloads\tensorflow\.bazelrc: --copt=/w --copt=/D_USE_MATH_DEFINES --host_copt=/D_USE_MATH_DEFINES --cxxopt=/std:c++14 --host_cxxopt=/std:c++14 --config=monolithic --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI --linkopt=/DEBUG --host_linkopt=/DEBUG --linkopt=/OPT:REF --host_linkopt=/OPT:REF --linkopt=/OPT:ICF --host_linkopt=/OPT:ICF --experimental_strict_action_env=true --verbose_failures --distinct_host_configuration=false
INFO: Found applicable config definition build:monolithic in file c:\users\sayan\downloads\tensorflow\.bazelrc: --define framework_shared_object=false
INFO: Build options --copt and --define have changed,discarding analysis cache.
INFO: Repository flatbuffers instantiated at:
  no stack (--record_rule_instantiation_callstack not enabled)
Repository rule third_party_http_archive defined at:
  C:/users/sayan/downloads/tensorflow/third_party/repo.bzl:216:43: in <toplevel>
INFO: Repository 'flatbuffers' used the following cache hits instead of downloading the corresponding file.
 * Hash '62f2223fb9181d1d6338451375628975775f7522185266cd5296571ac152bc45' for https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/flatbuffers/archive/v1.12.0.tar.gz
If the definition of 'flatbuffers' was updated,verify that the hashes were also updated.
ERROR: An error occurred during the fetch of repository 'flatbuffers':
   Traceback (most recent call last):
        File "C:/users/sayan/downloads/tensorflow/third_party/repo.bzl",line 193
                _apply_delete(ctx,<1 more arguments>)
        File "C:/users/sayan/downloads/tensorflow/third_party/repo.bzl",line 74,in _apply_delete
                _execute_and_check_ret_code(ctx,line 52,in _execute_and_check_ret_code
                fail(<1 more arguments>)
Non-zero return code(256) when executing ' c:\msys64\usr\bin\bash.exe -l -c "rm" "-rf" "C:/users/sayan/_bazel_sayan/xp7m463y/external/flatbuffers/build_defs.bzl"':
Stdout:
Stderr: java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("C:\users\sayan\_bazel_sayan\xp7m463y\external\flatbuffers\ c:\msys64\usr\bin\bash.exe" -l -c "\"rm\" \"-rf\" \"C:/users/sayan/_bazel_sayan/xp7m463y/external/flatbuffers/build_defs.bzl\""): The system cannot find the file specified.
 (error: 2)
ERROR: C:/users/sayan/downloads/tensorflow/tensorflow/tools/pip_package/BUILD:285:10: //tensorflow/tools/pip_package:build_pip_package depends on //tensorflow/lite/python:tflite_convert in repository @ which failed to fetch. no such package '@flatbuffers//': Traceback (most recent call last):
        File "C:/users/sayan/downloads/tensorflow/third_party/repo.bzl",in _execute_and_check_ret_code
                fail(<1 more arguments>)
Non-zero return code(256) when executing ' c:\msys64\usr\bin\bash.exe -l -c "rm" "-rf" "C:/users/sayan/_bazel_sayan/xp7m463y/external/flatbuffers/build_defs.bzl"':
Stdout:
Stderr: java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("C:\users\sayan\_bazel_sayan\xp7m463y\external\flatbuffers\ c:\msys64\usr\bin\bash.exe" -l -c "\"rm\" \"-rf\" \"C:/users/sayan/_bazel_sayan/xp7m463y/external/flatbuffers/build_defs.bzl\""): The system cannot find the file specified.
 (error: 2)
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: Analysis failed
INFO: Elapsed time: 15.662s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded,14 targets configured)
    currently loading: tensorflow/lite/python

forum中存在一个问题,尽管版本和解决方案不同。需要帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...