【发布时间】:2018-08-05 19:37:58
【问题描述】:
我已经安装了 Tensorflow Bazel 和 MSYS,我尝试使用 Win 中的以下命令编译 Tensorflow 以支持 CPU 扩展,例如 SSE4.1、SSE4.2、AVX、AVX2、FMA 10 命令提示符:
bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-
mfpmath=both --copt=-msse4.2 --config=cuda -k
//tensorflow/tools/pip_package:build_pip_package
但它失败并出现以下错误:
C:\WINDOWS\system32>bazel build -c opt --copt=-mavx --copt=-mavx2
--copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 --config=cuda -
k //tensorflow/tools/pip_package:build_pip_package
Bazel on Windows requires bash.exe and other Unix tools, but we
could not find them.
If you do not have them installed, the easiest is to install
MSYS2 from
http://repo.msys2.org/distrib/msys2-x86_64-latest.exe
or git-on-Windows from
https://git-scm.com/download/win
If you already have bash.exe installed but Bazel cannot find
it,
set BAZEL_SH environment variable to its location:
set BAZEL_SH=c:\path\to\bash.exe
[bazel INFO src/main/cpp/blaze_util_windows.cc:1231] Cannot
open
HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1
[bazel ERROR src/main/cpp/blaze_util_windows.cc:1303] bash.exe
not found on PATH
[bazel INFO src/main/cpp/blaze_util_windows.cc:1328] BAZEL_SH
detection took 0 msec, found
MSYS 运行正常,如下图:
ippok@DESKTOP-4QMUDH4 MSYS ~
$
【问题讨论】:
-
难道你不应该运行命令
bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=- mfpmath=both --copt=-msse4.2 --config=cuda -k //tensorflow/tools/pip_package:build_pip_packagein MSYS 吗? -
Bazel 在
cmd.exe上运行良好,无需从 MSYS 运行。
标签: tensorflow sse bazel avx msys