ubuntu 14.04
bazel 0.11.1
tensorflow分支r1.8
python 2.7.13
numpy 1.16.0
运行bazel build tensorflow / python / tools:freeze_graph,得到这个错误:
Executing genrule //tensorflow/tools/api/generator:python_api_gen failed (Aborted): bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped)
ImportError: No module named _multiarray_umath
ImportError: No module named _multiarray_umath
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
2019-01-23 15:07:42.016909: F tensorflow/python/lib/core/bfloat16.cc:664] Check failed: PyBfloat16_Type.tp_base != nullptr
/bin/bash: line 1: 16783 Aborted (core dumped) bazel-out/host/bin/tensorflow/tools/api/generator/create_python_api bazel-out/k8-opt/genfiles/tensorflow/tools/api/generator/api/__init__.py bazel-out/k8-opt/genfiles/tensorflow/tools/api/generator/api/app/__init__.py bazel-out/k8-opt/genfiles/tensorflow/tools/api/generator/api/bitwise/__init__.py bazel-out/k8-opt/genfiles/tensorflow/tools/api/generator/api/compat/__init__.py bazel-out/k8-opt/genfiles/tensorflow/tools/api/generator/api/contrib/__init__.py bazel-out/k8-opt/
...
Target //tensorflow/python/tools:freeze_graph failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1042.106s, Critical Path: 93.47s
FAILED: Build did NOT complete successfully
怎么了?
答案 0 :(得分:0)
错误表明_multiarray_umath
存在问题。
尝试先升级numpy:
pip install --upgrade numpy
如果仍然不起作用,请尝试以下命令:
sudo apt-get install python3-numpy