<p dir="auto">Running <a href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/ios_examples/simple">the simple iOS example</a> provided by this repository will crash if I target any iPhone 4s/iPhone 5 <strong>simulator</strong>. The app will crash immediately at launch, before entering <code class="notranslate">didFinishLaunchingWithOptions</code>. The last call I can identify in the debugger is usually <code class="notranslate">tensorflow::internal::LogMessageFatal::~LogMessageFatal:</code>.</p>
<p dir="auto">The crashes happen on iPhone 5 simulators running iOS 10.2, 9.3, and 9.1. And on iPhone 4s simulators running iOS 9.3, 9.1, and 8.4.</p>
<p dir="auto">I can reproduce this behavior with other TensorFlow iOS apps.</p>
<p dir="auto">The same apps that crash in an iPhone 4s/iPhone 5 simulator, will build &amp; run fine on other simulators &amp; devices, <em>e.g.</em> on iPad Air simulator running 10.2, a physical iPad Air running 10.2, or physical iPhone 6s Plus running 10.2. Tests on a device farm including iPhone 4s &amp; iPhone 5 devices were inconclusive… I’m seeing a very similar crash happen, <a href="https://docs.google.com/spreadsheets/d/1a1Erp-KPNA5bZuin5Fokzx0rVoqr2EEFEbKSEjEVpTw/edit" rel="nofollow">mostly affecting devices running 9.3.5</a>, but the devices/iOS combos that fail on physical devices are slightly inconsistent from run to run (in the simulator the same devices crash 100% of the time no matter what OS I use, and from run to run).</p>
<h3 dir="auto">What related GitHub issues or StackOverflow threads have you found by searching the web for your problem?</h3>
<p dir="auto">This <a href="https://github.com/tensorflow/tensorflow/issues/4640" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/4640/hovercard">issue</a> is the only hit I get, but seems unrelated.</p>
<h3 dir="auto">Environment info</h3>
<ul dir="auto">
<li>Operating System: macOS Sierra 10.12.13</li>
<li>Commit hash: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/tensorflow/tensorflow/commit/b393fd79fd43242ea9be3ff3141f1809c412fd71/hovercard" href="https://github.com/tensorflow/tensorflow/commit/b393fd79fd43242ea9be3ff3141f1809c412fd71"><tt>b393fd7</tt></a> (master as of this writing)</li>
<li>Bazel Version:
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Build label: 0.4.3-jdk7
Build target: bazel-out/local-    fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 22 12:31:38 2016 (1482409898)
Build timestamp: 1482409898
Build timestamp as int: 1482409898"><pre class="notranslate"><code class="notranslate">Build label: 0.4.3-jdk7
Build target: bazel-out/local-    fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 22 12:31:38 2016 (1482409898)
Build timestamp: 1482409898
Build timestamp as int: 1482409898
</code></pre></div>
</li>
</ul>
<h3 dir="auto">Minimal reproducible example</h3>
<ol dir="auto">
<li>Prepare the simple iOS example provided by Tensorflow
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ git clone https://github.com/tensorflow/tensorflow.git
$ cd tensorflow
$ tensorflow/contrib/makefile/download_dependencies.sh
$ tensorflow/contrib/makefile/build_all_ios.sh
$ open tensorflow/contrib/ios_examples/simple/tf_ios_makefile_example.xcodeproj"><pre class="notranslate">$ git clone https://github.com/tensorflow/tensorflow.git
$ <span class="pl-c1">cd</span> tensorflow
$ tensorflow/contrib/makefile/download_dependencies.sh
$ tensorflow/contrib/makefile/build_all_ios.sh
$ open tensorflow/contrib/ios_examples/simple/tf_ios_makefile_example.xcodeproj</pre></div>
</li>
<li>Download the Inception graph per the <a href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile#ios">instructions</a></li>
<li>Target the iPhone 5 simulator on iOS 10.2, and Run.</li>
<li>The app will crash before entering <code class="notranslate">didFinishLaunchingWithOptions</code>.</li>
<li>(If you target the iPad Air simulator on iOS 10.2, it will work.)</li>
</ol>
<p dir="auto">Have I written custom code: N/A<br>
OS Platform and Distribution: cpe:/o:centos:centos:7<br>
TensorFlow installed from: pip install<br>
TensorFlow version: 1.10<br>
Bazel version: N/A<br>
CUDA/cuDNN version: Cuda 9.0<br>
GPU model and memory: 1080 Ti, 11G<br>
Exact command to reproduce: N/A<br>
Mobile device: N/A</p>
<p dir="auto">I checked the <a href="https://www.tensorflow.org/community/roadmap" rel="nofollow">roadmap</a> says the new feature:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Eager execution

    Use DistributionStrategy to utilize multiple GPUs and multiple TPU cores.
    Distributed training support (multi-machine).
    Performance improvements.
    Simpler export to a GraphDef/SavedModel."><pre class="notranslate"><code class="notranslate">Eager execution

    Use DistributionStrategy to utilize multiple GPUs and multiple TPU cores.
    Distributed training support (multi-machine).
    Performance improvements.
    Simpler export to a GraphDef/SavedModel.
</code></pre></div>
<p dir="auto">I am wondering whether tf 2.0 will consider synchronizing batchnorm statistics across multiple GPUs which is extremely helpful for segmentation and other task.</p>
<p dir="auto">Similar issue as <a href="https://github.com/tensorflow/tensorflow/issues/18222" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/18222/hovercard">Synchronized BatchNorm statistics across GPUs</a></p>