【问题标题】:build tensorflow r1.12 mkl on Windows using bazel, result in link error使用 bazel 在 Windows 上构建 tensorflow r1.12 mkl,导致链接错误
【发布时间】:2018-11-01 05:59:27
【问题描述】:

我正在尝试通过 Bazel 使用命令在 Windows 10 64 位上编译具有 MKL 支持的 tensorflow:

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

在以下环境中:

  • Windows 10 64 位
  • 张量流 1.12
  • 巴泽尔 0.18

我不知道我的配置有什么问题,我尝试过 tensorflow r1.11 和 r1.12。两者都以同样的问题结束,日志是:

    ERROR: F:/tools/tf1.12/tensorflow/tensorflow/python/BUILD:3766:1: Linking of rule '//tensorflow/python:_pywrap_tensorflow_internal.so' failed (Exit 1000): link.exe failed: error executing command
  cd C:/users/10267/_bazel_10267/udaytyio/execroot/org_tensorflow
  SET LIB=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64;
    SET PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64;C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\8.1\bin\x64;C:\Program Files (x86)\Windows Kits\8.1\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\;;C:\WINDOWS\system32
    SET PWD=/proc/self/cwd
    SET PYTHON_BIN_PATH=C:/Program Files/Python36/python.exe
    SET PYTHON_LIB_PATH=C:/Program Files/Python36/lib/site-packages
    SET TEMP=C:\Users\10267\AppData\Local\Temp
    SET TF_DOWNLOAD_CLANG=0
    SET TF_NEED_CUDA=0
    SET TF_NEED_OPENCL_SYCL=0
    SET TMP=C:\Users\10267\AppData\Local\Temp
  C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/link.exe /nologo /DLL /SUBSYSTEM:CONSOLE -defaultlib:advapi32.lib -DEFAULTLIB:advapi32.lib /MACHINE:X64 @bazel-out/x64_windows-opt/bin/tensorflow/python/_pywrap_tensorflow_internal.so-2.params /OPT:ICF /OPT:REF /DEF:bazel-out/x64_windows-opt/genfiles/tensorflow/python/pywrap_tensorflow_filtered_def_file.def /ignore:4070
LINK : warning LNK4044: unrecognized option '/lpthread'; ignored

bazel-out/x64_windows-opt/bin/external/nsync/nsync_cpp.lib : fatal error LNK1000: Internal error during CImplib::EmitThunk

  Version 14.00.24215.1

  ExceptionCode            = C0000005
  ExceptionFlags           = 00000000
  ExceptionAddress         = 00007FF7E0686896 (00007FF7E0670000) "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\link.exe"
  NumberParameters         = 00000002
  ExceptionInformation[ 0] = 0000000000000000
  ExceptionInformation[ 1] = 0000000000000008

CONTEXT:
  Rax    = 0000000000000000  R8     = 00007FF7E076FBE0
  Rbx    = 0000000000000000  R9     = 00007FF7E076E9F0
  Rcx    = 0000000000000000  R10    = 0000000000000000
  Rdx    = 00007FF7E076FBD8  R11    = 0000000000000000
  Rsp    = 000000082B71DE68  R12    = 00007FF7E073D950
  Rbp    = 000001A60F8F8360  E13    = 0000000000000000
  Rsi    = 0000000000008000  R14    = 0000000000000000
  Rdi    = 000001A6102AA300  R15    = 0000000000000000
  Rip    = 00007FF7E0686896  EFlags = 0000000000010246
  SegCs  = 0000000000000033  SegDs  = 000000000000002B
  SegSs  = 000000000000002B  SegEs  = 000000000000002B
  SegFs  = 0000000000000053  SegGs  = 000000000000002B
  Dr0    = 0000000000000000  Dr3    = 0000000000000000
  Dr1    = 0000000000000000  Dr6    = 0000000000000000
  Dr2    = 0000000000000000  Dr7    = 0000000000000000
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 3172.917s, Critical Path: 253.76s
INFO: 3875 processes: 3875 local.
FAILED: Build did NOT complete successfully

而且我也尝试在没有 --config=mkl 术语的情况下构建它,这是成功的,所以我想知道这个错误是否与 mkl 有点关系?

【问题讨论】:

    标签: windows tensorflow build bazel intel-mkl


    【解决方案1】:

    请尝试英特尔代表的此 github 问题响应中描述的解决方法。 https://github.com/tensorflow/tensorflow/issues/23420

    或使用 conda 并按照此处“Windows 和 MacOS”部分中的说明进行操作: https://software.intel.com/en-us/articles/intel-optimization-for-tensorflow-installation-guide

    【讨论】:

      猜你喜欢
      • 2019-01-03
      • 1970-01-01
      • 1970-01-01
      • 2020-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多