Issue 1:
System information

OS Platform and Distribution : Ubuntu 16.04.3

TensorFlow installed from: pip

TensorFlow version: 2.0 alpha

I am using bazel to convert .pb file to .tflite. This is the command that I used to convert the model.

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

I receive the following output:

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

When I added the --allow_custom_ops flag to the same command above, I received the following output:

E tensorflow/lite/toco/toco_tooling.cc:456] TensorFlow Lite currently doesn't support control flow ops: Enter, Exit, Merge, Switch.

It is possible to avoid using those control flow ops (Enter, Exit, Merge, Switch) in my original .pb model?

Thanks for your help.

Issue 2:
Building tensorflow using the makefile method, i get the below error,

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__gnu_h2f_ieee':

(.text+0x12a): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol __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__gnu_h2f_alternative':

(.text+0x132): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol __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__gnu_h2f_ieee':

(.text+0x12a): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol __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__gnu_h2f_alternative':

(.text+0x132): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol __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__gnu_h2f_ieee':

(.text+0x12a): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol __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__gnu_h2f_alternative':

(.text+0x132): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol __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

From what i understand this appears to be an issue with the linker trying to branch on a long address,

https://lists.gnu.org/archive/html/bug-binutils/2007-06/msg00065.html

But this issue is back from 2007, any workaround i can do on the source to avoid this?

System:

gcc version 4.8.4 (Debian 4.8.4-1)

GNU ld (GNU Binutils for Debian) 2.25