<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>OS Platform and Distribution : Ubuntu 16.04.3</li>
<li>TensorFlow installed from: pip</li>
<li>TensorFlow version: 2.0 alpha</li>
</ul>
<p dir="auto">I am using bazel to convert .pb file to .tflite. This is the command that I used to convert the model.</p>
<p dir="auto">abdullah@abdullah-OptiPlex-7060:~/tensorflow/tensorflow/lite/toco$ bazel run . --define=with_select_tf_ops=true -- --output_file=/home/abdullah/Documents/CRNN_MODEL/bazelled.tflite   --input_file=/home/abdullah/Documents/CRNN_MODEL/my_model__.pb   --input_arrays=the_input   --output_arrays=softmax/truediv</p>
<p dir="auto">I receive the following output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Some of the operators in the model are not supported by the standard TensorFlow Lite runtime. If those are native TensorFlow operators, you might be able to use the extended runtime by passing --enable_select_tf_ops, or by setting target_ops=TFLITE_BUILTINS,SELECT_TF_OPS when calling tf.lite.TFLiteConverter(). Otherwise, if you have a custom implementation for them you can disable this error with --allow_custom_ops, or by setting allow_custom_ops=True when calling tf.lite.TFLiteConverter(). Here is a list of builtin operators you are using: ADD, CONCATENATION, CONV_2D, DIV, EXP, EXPAND_DIMS, FULLY_CONNECTED, LESS, LOGICAL_AND, MAXIMUM, MAX_POOL_2D, MINIMUM, MUL, PACK, RANGE, REDUCE_MAX, RESHAPE, REVERSE_V2, SHAPE, STRIDED_SLICE, SUB, SUM, TANH, TILE, TRANSPOSE, UNPACK, ZEROS_LIKE. Here is a list of operators for which you will need custom implementations: Enter, Exit, LoopCond, Merge, Switch, TensorArrayGatherV3, TensorArrayReadV3, TensorArrayScatterV3, TensorArraySizeV3, TensorArrayV3, TensorArrayWriteV3"><pre class="notranslate"><code class="notranslate">Some of the operators in the model are not supported by the standard TensorFlow Lite runtime. If those are native TensorFlow operators, you might be able to use the extended runtime by passing --enable_select_tf_ops, or by setting target_ops=TFLITE_BUILTINS,SELECT_TF_OPS when calling tf.lite.TFLiteConverter(). Otherwise, if you have a custom implementation for them you can disable this error with --allow_custom_ops, or by setting allow_custom_ops=True when calling tf.lite.TFLiteConverter(). Here is a list of builtin operators you are using: ADD, CONCATENATION, CONV_2D, DIV, EXP, EXPAND_DIMS, FULLY_CONNECTED, LESS, LOGICAL_AND, MAXIMUM, MAX_POOL_2D, MINIMUM, MUL, PACK, RANGE, REDUCE_MAX, RESHAPE, REVERSE_V2, SHAPE, STRIDED_SLICE, SUB, SUM, TANH, TILE, TRANSPOSE, UNPACK, ZEROS_LIKE. Here is a list of operators for which you will need custom implementations: Enter, Exit, LoopCond, Merge, Switch, TensorArrayGatherV3, TensorArrayReadV3, TensorArrayScatterV3, TensorArraySizeV3, TensorArrayV3, TensorArrayWriteV3
</code></pre></div>
<p dir="auto">When I added the  --allow_custom_ops flag to the same command above, I received the following output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="E tensorflow/lite/toco/toco_tooling.cc:456] TensorFlow Lite currently doesn't support control flow ops: Enter, Exit, Merge, Switch."><pre class="notranslate"><code class="notranslate">E tensorflow/lite/toco/toco_tooling.cc:456] TensorFlow Lite currently doesn't support control flow ops: Enter, Exit, Merge, Switch.
</code></pre></div>
<p dir="auto">It is possible to avoid using those control flow ops (Enter, Exit, Merge, Switch) in my original .pb model?<br>
Thanks for your help.</p>
<p dir="auto">Building tensorflow using the makefile method, i get the below error,</p>
<p dir="auto"><code class="notranslate">PROTOC = "protoc" CC_PREFIX = "" gcc --std=c++11 -DIS_SLIM_BUILD -O0 -I/usr/local/include -I. -I/home/olimex/tf/tensorflow/tensorflow/contrib/makefile/downloads/ -I/home/olimex/tf/tensorflow/tensorflow/contrib/makefile/downloads/eigen-eigen-334b1d428283 -I/home/olimex/tf/tensorflow/tensorflow/contrib/makefile/gen/proto/ -I/home/olimex/tf/tensorflow/tensorflow/contrib/makefile/gen/proto_text/ \ -o /home/olimex/tf/tensorflow/tensorflow/contrib/makefile/gen/bin/benchmark /home/olimex/tf/tensorflow/tensorflow/contrib/makefile/gen/obj/tensorflow/core/util/reporter.o /home/olimex/tf/tensorflow/tensorflow/contrib/makefile/gen/obj/tensorflow/tools/benchmark/benchmark_model.o /home/olimex/tf/tensorflow/tensorflow/contrib/makefile/gen/obj/tensorflow/tools/benchmark/benchmark_model_main.o \ -Wl,--allow-multiple-definition -Wl,--whole-archive /home/olimex/tf/tensorflow/tensorflow/contrib/makefile/gen/lib/libtensorflow-core.a -L/usr/local/lib -lstdc++ -lprotobuf -lz -lm -ldl -lpthread /usr/lib/gcc/arm-linux-gnueabihf/4.8/libgcc.a(fp16.o): In function</code>__gnu_h2f_ieee':<br>
(.text+0x12a): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol <code class="notranslate">__gnu_h2f_internal' defined in .text section in /usr/lib/gcc/arm-linux-gnueabihf/4.8/libgcc.a(fp16.o) /usr/lib/gcc/arm-linux-gnueabihf/4.8/libgcc.a(fp16.o): In function</code>__gnu_h2f_alternative':<br>
(.text+0x132): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol <code class="notranslate">__gnu_h2f_internal' defined in .text section in /usr/lib/gcc/arm-linux-gnueabihf/4.8/libgcc.a(fp16.o) /usr/lib/gcc/arm-linux-gnueabihf/4.8/libgcc.a(fp16.o): In function</code>__gnu_h2f_ieee':<br>
(.text+0x12a): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol <code class="notranslate">__gnu_h2f_internal' defined in .text section in /usr/lib/gcc/arm-linux-gnueabihf/4.8/libgcc.a(fp16.o) /usr/lib/gcc/arm-linux-gnueabihf/4.8/libgcc.a(fp16.o): In function</code>__gnu_h2f_alternative':<br>
(.text+0x132): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol <code class="notranslate">__gnu_h2f_internal' defined in .text section in /usr/lib/gcc/arm-linux-gnueabihf/4.8/libgcc.a(fp16.o) /usr/lib/gcc/arm-linux-gnueabihf/4.8/libgcc.a(fp16.o): In function</code>__gnu_h2f_ieee':<br>
(.text+0x12a): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol <code class="notranslate">__gnu_h2f_internal' defined in .text section in /usr/lib/gcc/arm-linux-gnueabihf/4.8/libgcc.a(fp16.o) /usr/lib/gcc/arm-linux-gnueabihf/4.8/libgcc.a(fp16.o): In function</code>__gnu_h2f_alternative':<br>
(.text+0x132): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol <code class="notranslate">__gnu_h2f_internal' defined in .text section in /usr/lib/gcc/arm-linux-gnueabihf/4.8/libgcc.a(fp16.o) collect2: error: ld returned 1 exit status</code></p>
<p dir="auto">From what i understand this appears to be an issue with the linker trying to branch on a long address,<br>
<a href="https://lists.gnu.org/archive/html/bug-binutils/2007-06/msg00065.html" rel="nofollow">https://lists.gnu.org/archive/html/bug-binutils/2007-06/msg00065.html</a><br>
But this issue is back from 2007, any workaround i can do on the source to avoid this?</p>
<p dir="auto">System:<br>
gcc version 4.8.4 (Debian 4.8.4-1)<br>
GNU ld (GNU Binutils for Debian) 2.25</p>