Closed Mr-Grieves closed 3 years ago
Thanks for the report. Have you tried with a non-optimized build? That might help provide symbols for the crash stack.
Assigning to @miaout17 for further assistance.
@jdduke: I just tried rebuilding my .aar without -c opt
and it did not change anything in the crash stack.
Also, as a small update: this issue does not seems to be present when I build the test network using tensorflow 2.0. Unfortunately, the actual keras network I am trying to work with was trained using v1.13.1 so that does not solve my issue.
I'm curious, if you change your conversion target ops to just
converter.target_ops = [tf.lite.OpsSet.TFLITE_BUILTINS]
Does that make any difference?
@jdduke: Without the SELECT_OPS, my converter script fails to create the tflite model. It gives the following errors:
2019-11-26 18:14:50.278227: E tensorflow/core/grappler/grappler_item_builder.cc:656] Init node conv/kernel/Assign doesn't exist in graph
Traceback (most recent call last):
File "convert_conv3d", line 23, in <module>
tflite_model = converter.convert()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/lite/python/lite.py", line 983, in convert
**converter_kwargs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/lite/python/convert.py", line 449, in toco_convert_impl
enable_mlir_converter=enable_mlir_converter)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/lite/python/convert.py", line 200, in toco_convert_protos
raise ConverterError("See console for info.\n%s\n%s\n" % (stdout, stderr))
tensorflow.lite.python.convert.ConverterError: See console for info.
2019-11-26 18:14:51.414259: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Conv3D
2019-11-26 18:14:51.414371: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] Before Removing unused ops: 4 operators, 7 arrays (0 quantized)
2019-11-26 18:14:51.415422: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] Before general graph transformations: 4 operators, 7 arrays (0 quantized)
2019-11-26 18:14:51.415487: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] After general graph transformations pass 1: 2 operators, 5 arrays (0 quantized)
2019-11-26 18:14:51.415521: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] Before Group bidirectional sequence lstm/rnn: 2 operators, 5 arrays (0 quantized)
2019-11-26 18:14:51.415532: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] Before dequantization graph transformations: 2 operators, 5 arrays (0 quantized)
2019-11-26 18:14:51.415576: I tensorflow/lite/toco/allocate_transient_arrays.cc:345] Total transient array allocated size: 0 bytes, theoretical optimal value: 0 bytes.
2019-11-26 18:14:51.415583: I tensorflow/lite/toco/toco_tooling.cc:454] Number of parameters: 1001
2019-11-26 18:14:51.416249: E tensorflow/lite/toco/toco_tooling.cc:481] We are continually in the process of adding support to TensorFlow Lite for more ops. It would be helpful if you could inform us of how this conversion went by opening a github issue at https://github.com/tensorflow/tensorflow/issues/new?template=40-tflite-op-request.md
and pasting the following:
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. Here is a list of operators for which you will need custom implementations: Conv3D.
Ah, sorry, what I meant to write was change the target ops to just:
converter.target_ops = [lite.OpsSet.SELECT_TF_OPS]
Oho! that appears to have solved it!! Great. Thank you for the suggestion
Hi There,
We are checking to see if you still need help on this, as you are using an older version of tensorflow which is officially considered end of life . We recommend that you upgrade to the latest 2.x version and let us know if the issue still persists in newer versions. Please open a new issue for any help you need against 2.x, and we will get you the right help.
This issue will be closed automatically 7 days from now. If you still need help with this issue, please provide us with more information.
System information
Describe the current behavior I am trying to get a network (with conv3d ops) to run on my Android system using TFLite. I have followed all the steps mentioned here, and I can convert the network without issue. During runtime, I also appear to be able to load the converted tflite model without issue, however, during my call to
runForMultipleInputsOutputs()
, tflite crashes giving me a SIBABRT coming from libtensorflowlite_flex_jni.so (full stack trace below).Describe the expected behavior I expect it to not crash when running
Code to reproduce the issue I made a dummy network to try and isolate the issue. I built the network using the following:
I then load and run the model on the android using ByteBuffers to hold the input/outputs. I can provide this code if requested, but I don't suspect it to be the problem as I use it for other working projects. I'm confident that this is a conv3d issue, because I have also built a conv2d dummy network, using the exact same build procedure + runtime environment, and it runs without crashing.
Other info / logs The full android backtrace during the call to runForMultipleInputsOutputs():