<p dir="auto">I'm running linux x86_64, OpenSuse 13.1</p>
<p dir="auto">I am trying to compile from the repo master branch 875a67f with Bazel 1.4, installed from <code class="notranslate">bazel-0.1.4-installer-linux-x86_64.sh</code></p>
<p dir="auto">I was getting dependency errors and had to make the modifications described in <a href="http://stackoverflow.com/questions/35256110/tensorflow-build-fails-with-missing-dependency-error" rel="nofollow">this stack overflow post</a> to my Bazel setup</p>
<p dir="auto">This got me past my initial dependency errors (described exactly in detail by StackOverflow OP in above post), but now I've got another error when trying to run this command:</p>
<p dir="auto"><code class="notranslate">bazel build --verbose_failures -c opt //tensorflow/tools/pip_package:build_pip_package </code></p>
<p dir="auto">The relevant output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="INFO: From Compiling tensorflow/python/lib/core/py_func.cc:
tensorflow/python/lib/core/py_func.cc:19:31: fatal error: numpy/arrayobject.h: No such file or directory
 #include &quot;numpy/arrayobject.h&quot;
                               ^
compilation terminated.
ERROR: /home/personal/files/learning/tensorflow/tensorflow/tensorflow/python/BUILD:75:1: C++ compilation of rule '//tensorflow/python:py_func_lib' failed: gcc failed: error executing command
  (cd /root/.cache/bazel/_bazel_root/f202f08f55600b1b30922b1248222df1/tensorflow &amp;&amp; \
  exec env - \
    PATH=/usr/lib64/mpi/gcc/openmpi/bin:/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/cross/bin:/usr/local/go/bin \
  /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -iquote . -iquote bazel-out/local_linux-opt/genfiles -iquote external/bazel_tools -iquote bazel-out/local_linux-opt/genfiles/external/bazel_tools -iquote external/jpeg_archive -iquote bazel-out/local_linux-opt/genfiles/external/jpeg_archive -iquote external/png_archive -iquote bazel-out/local_linux-opt/genfiles/external/png_archive -iquote external/re2 -iquote bazel-out/local_linux-opt/genfiles/external/re2 -iquote external/eigen_archive -iquote bazel-out/local_linux-opt/genfiles/external/eigen_archive -isystem google/protobuf/src -isystem bazel-out/local_linux-opt/genfiles/google/protobuf/src -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/jpeg_archive/jpeg-9a -isystem bazel-out/local_linux-opt/genfiles/external/jpeg_archive/jpeg-9a -isystem external/png_archive/libpng-1.2.53 -isystem bazel-out/local_linux-opt/genfiles/external/png_archive/libpng-1.2.53 -isystem external/re2 -isystem bazel-out/local_linux-opt/genfiles/external/re2 -isystem third_party/eigen3 -isystem bazel-out/local_linux-opt/genfiles/third_party/eigen3 -isystem external/eigen_archive/eigen-eigen-70505a059011 -isystem bazel-out/local_linux-opt/genfiles/external/eigen_archive/eigen-eigen-70505a059011 -isystem third_party/py/numpy/numpy_include -isystem bazel-out/local_linux-opt/genfiles/third_party/py/numpy/numpy_include -isystem util/python/python_include -isystem bazel-out/local_linux-opt/genfiles/util/python/python_include -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__=&quot;redacted&quot;' '-D__TIMESTAMP__=&quot;redacted&quot;' '-D__TIME__=&quot;redacted&quot;' '-frandom-seed=bazel-out/local_linux-opt/bin/tensorflow/python/_objs/py_func_lib/tensorflow/python/lib/core/py_func.pic.o' -MD -MF bazel-out/local_linux-opt/bin/tensorflow/python/_objs/py_func_lib/tensorflow/python/lib/core/py_func.pic.d -fPIC -c tensorflow/python/lib/core/py_func.cc -o bazel-out/local_linux-opt/bin/tensorflow/python/_objs/py_func_lib/tensorflow/python/lib/core/py_func.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1: gcc failed: error executing command
  (cd /root/.cache/bazel/_bazel_root/f202f08f55600b1b30922b1248222df1/tensorflow &amp;&amp; \
  exec env - \"><pre class="notranslate"><code class="notranslate">INFO: From Compiling tensorflow/python/lib/core/py_func.cc:
tensorflow/python/lib/core/py_func.cc:19:31: fatal error: numpy/arrayobject.h: No such file or directory
 #include "numpy/arrayobject.h"
                               ^
compilation terminated.
ERROR: /home/personal/files/learning/tensorflow/tensorflow/tensorflow/python/BUILD:75:1: C++ compilation of rule '//tensorflow/python:py_func_lib' failed: gcc failed: error executing command
  (cd /root/.cache/bazel/_bazel_root/f202f08f55600b1b30922b1248222df1/tensorflow &amp;&amp; \
  exec env - \
    PATH=/usr/lib64/mpi/gcc/openmpi/bin:/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/cross/bin:/usr/local/go/bin \
  /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -iquote . -iquote bazel-out/local_linux-opt/genfiles -iquote external/bazel_tools -iquote bazel-out/local_linux-opt/genfiles/external/bazel_tools -iquote external/jpeg_archive -iquote bazel-out/local_linux-opt/genfiles/external/jpeg_archive -iquote external/png_archive -iquote bazel-out/local_linux-opt/genfiles/external/png_archive -iquote external/re2 -iquote bazel-out/local_linux-opt/genfiles/external/re2 -iquote external/eigen_archive -iquote bazel-out/local_linux-opt/genfiles/external/eigen_archive -isystem google/protobuf/src -isystem bazel-out/local_linux-opt/genfiles/google/protobuf/src -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/jpeg_archive/jpeg-9a -isystem bazel-out/local_linux-opt/genfiles/external/jpeg_archive/jpeg-9a -isystem external/png_archive/libpng-1.2.53 -isystem bazel-out/local_linux-opt/genfiles/external/png_archive/libpng-1.2.53 -isystem external/re2 -isystem bazel-out/local_linux-opt/genfiles/external/re2 -isystem third_party/eigen3 -isystem bazel-out/local_linux-opt/genfiles/third_party/eigen3 -isystem external/eigen_archive/eigen-eigen-70505a059011 -isystem bazel-out/local_linux-opt/genfiles/external/eigen_archive/eigen-eigen-70505a059011 -isystem third_party/py/numpy/numpy_include -isystem bazel-out/local_linux-opt/genfiles/third_party/py/numpy/numpy_include -isystem util/python/python_include -isystem bazel-out/local_linux-opt/genfiles/util/python/python_include -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_linux-opt/bin/tensorflow/python/_objs/py_func_lib/tensorflow/python/lib/core/py_func.pic.o' -MD -MF bazel-out/local_linux-opt/bin/tensorflow/python/_objs/py_func_lib/tensorflow/python/lib/core/py_func.pic.d -fPIC -c tensorflow/python/lib/core/py_func.cc -o bazel-out/local_linux-opt/bin/tensorflow/python/_objs/py_func_lib/tensorflow/python/lib/core/py_func.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1: gcc failed: error executing command
  (cd /root/.cache/bazel/_bazel_root/f202f08f55600b1b30922b1248222df1/tensorflow &amp;&amp; \
  exec env - \
</code></pre></div>
<p dir="auto">Can anyone offer assistance with building?</p>
<p dir="auto"><em>Please make sure that this is a bug. As per our <a href="https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md">GitHub Policy</a>, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template</em></p>
<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>Have I written custom code (as opposed to using a stock example script provided in TensorFlow):</li>
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04):16.04</li>
<li>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:</li>
<li>TensorFlow installed from (source or binary):pip install</li>
<li>TensorFlow version (use command below):1.12</li>
<li>Python version:3.5</li>
<li>Bazel version (if compiling from source):</li>
<li>GCC/Compiler version (if compiling from source):</li>
<li>CUDA/cuDNN version:</li>
<li>GPU model and memory:</li>
</ul>
<p dir="auto">TF version = 1.12<br>
tfnightly = 1.13.0.dev20190104<br>
python 3.5<br>
Model ssd_mobilenet_v1_coco_2018_01_28</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import tensorflow as tf
import sys
def convert(frozen):
	graph_def_file = frozen+&quot;/frozen_inference_graph.pb&quot;
	input_arrays = [&quot;image_tensor&quot;]
	output_arrays = [&quot;detection_boxes&quot;,&quot;detection_scores&quot;,&quot;detection_classes&quot;,&quot;num_detections&quot;]
	converter = tf.contrib.lite.TFLiteConverter.from_frozen_graph(graph_def_file,input_arrays,output_arrays)#,input_shapes={&quot;image_tensor&quot;:[None,300,300,3]})
	tflite_model = converter.convert()
	open(frozen+&quot;/model.tflite&quot;, &quot;wb&quot;).write(tflite_model)

if __name__=='__main__':
	frozen_path = sys.argv[1]
	convert(frozen_path)"><pre class="notranslate"><code class="notranslate">import tensorflow as tf
import sys
def convert(frozen):
	graph_def_file = frozen+"/frozen_inference_graph.pb"
	input_arrays = ["image_tensor"]
	output_arrays = ["detection_boxes","detection_scores","detection_classes","num_detections"]
	converter = tf.contrib.lite.TFLiteConverter.from_frozen_graph(graph_def_file,input_arrays,output_arrays)#,input_shapes={"image_tensor":[None,300,300,3]})
	tflite_model = converter.convert()
	open(frozen+"/model.tflite", "wb").write(tflite_model)

if __name__=='__main__':
	frozen_path = sys.argv[1]
	convert(frozen_path)
</code></pre></div>
<p dir="auto">Error</p>
<blockquote>
<p dir="auto">2019-01-07 09:01:08.263004: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA<br>
2019-01-07 09:01:08.268020: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300030000 Hz<br>
2019-01-07 09:01:08.268185: I tensorflow/compiler/xla/service/service.cc:161] XLA service 0x56b0400 executing computations on platform Host. Devices:<br>
2019-01-07 09:01:08.268255: I tensorflow/compiler/xla/service/service.cc:168] StreamExecutor device (0): ,<br>
2019-01-07 09:01:09.412404: I tensorflow/core/grappler/devices.cc:53] Number of eligible GPUs (core count &gt;= 8): 0 (Note: TensorFlow was not compiled with CUDA support)<br>
2019-01-07 09:01:09.412562: I tensorflow/core/grappler/clusters/single_machine.cc:359] Starting new session<br>
2019-01-07 09:01:11.571194: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:584] Optimization results for grappler item: graph_to_optimize<br>
2019-01-07 09:01:11.571245: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] model_pruner: Graph size after: 5957 nodes (-3), 10020 edges (-3), time = 68.272ms.<br>
2019-01-07 09:01:11.571253: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] function_optimizer: Graph size after: 5957 nodes (0), 10020 edges (0), time = 13.564ms.<br>
2019-01-07 09:01:11.571259: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] constant folding: Graph size after: 5958 nodes (1), 10022 edges (2), time = 539.625ms.<br>
2019-01-07 09:01:11.571265: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] shape_optimizer: Graph size after: 5958 nodes (0), 10022 edges (0), time = 31.515ms.<br>
2019-01-07 09:01:11.571271: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] arithmetic_optimizer: Graph size after: 4306 nodes (-1652), 8412 edges (-1610), time = 243.152ms.<br>
2019-01-07 09:01:11.571280: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] loop_optimizer: Graph size after: 4289 nodes (-17), 8380 edges (-32), time = 43.908ms.<br>
2019-01-07 09:01:11.571289: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] dependency_optimizer: Graph size after: 4272 nodes (-17), 8358 edges (-22), time = 103.724ms.<br>
2019-01-07 09:01:11.571299: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] layout: Graph size after: 4272 nodes (0), 8358 edges (0), time = 15.684ms.<br>
2019-01-07 09:01:11.571309: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] memory_optimizer: Graph size after: 4272 nodes (0), 8358 edges (0), time = 263.292ms.<br>
2019-01-07 09:01:11.571319: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] model_pruner: Graph size after: 4258 nodes (-14), 8332 edges (-26), time = 43.246ms.<br>
2019-01-07 09:01:11.571329: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] function_optimizer: Graph size after: 4258 nodes (0), 8332 edges (0), time = 11.187ms.<br>
2019-01-07 09:01:11.571338: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] constant folding: Graph size after: 4258 nodes (0), 8332 edges (0), time = 305.64ms.<br>
2019-01-07 09:01:11.571348: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] shape_optimizer: Graph size after: 4258 nodes (0), 8332 edges (0), time = 22.274ms.<br>
2019-01-07 09:01:11.571358: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] arithmetic_optimizer: Graph size after: 4256 nodes (-2), 8328 edges (-4), time = 192.768ms.<br>
2019-01-07 09:01:11.571367: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] dependency_optimizer: Graph size after: 4256 nodes (0), 8328 edges (0), time = 100.01ms.<br>
Traceback (most recent call last):<br>
File "export_graph.py", line 15, in<br>
convert(frozen_path)<br>
File "export_graph.py", line 10, in convert<br>
tflite_model = converter.convert()<br>
File "/home/ubuntu/.local/lib/python3.5/site-packages/tensorflow/lite/python/lite.py", line 499, in convert<br>
**converter_kwargs)<br>
File "/home/ubuntu/.local/lib/python3.5/site-packages/tensorflow/lite/python/convert.py", line 445, in toco_convert_impl<br>
input_data.SerializeToString())<br>
File "/home/ubuntu/.local/lib/python3.5/site-packages/tensorflow/lite/python/convert.py", line 208, in toco_convert_protos<br>
"TOCO failed. See console for info.\n%s\n%s\n" % (stdout, stderr))<br>
tensorflow.lite.python.convert.ConverterError: TOCO failed. See console for info.<br>
2019-01-07 09:01:12.809603: F tensorflow/core/framework/function.cc:1640] Check failed: GetOpGradFactory()-&gt;insert({op, func}).second Duplicated gradient for ReadVariableOp<br>
Aborted (core dumped)</p>
</blockquote>