Segmentation Fault when inference in Google Coral Dev Board mini
#0 0x0000007ff7d01710 in strlen () from /lib/aarch64-linux-gnu/libc.so.6
https://github.com/google-coral/edgetpu/issues/1 0x0000007ff5ac1264 in tflite::InterpreterBuilder::ParseSignatureDefs(flatbuffers::Vector<flatbuffers::Offsettflite::SignatureDef > const*, tflite::Interpreter*) ()
from /usr/lib/python3/dist-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.cpython-37m-aarch64-linux-gnu.so
https://github.com/google-coral/edgetpu/pull/2 0x0000007ff5ac19d4 in tflite::InterpreterBuilder::operator()(std::unique_ptr<tflite::Interpreter, std::default_deletetflite::Interpreter >, int) ()
from /usr/lib/python3/dist-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.cpython-37m-aarch64-linux-gnu.so
https://github.com/google-coral/edgetpu/issues/3 0x0000007ff58f3440 in tflite::interpreter_wrapper::InterpreterWrapper::CreateInterpreterWrapper(std::unique_ptr<tflite::FlatBufferModel, std::default_deletetflite::FlatBufferModel >, std::unique_ptr<tflite::interpreter_wrapper::PythonErrorReporter, std::default_deletetflite::interpreter_wrapper::PythonErrorReporter >, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, std::vector<std::function<void (unsigned long)>, std::allocator<std::function<void (unsigned long)> > > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >) ()
from /usr/lib/python3/dist-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.cpython-37m-aarch64-linux-gnu.so
https://github.com/google-coral/edgetpu/issues/4 0x0000007ff58f39c0 in tflite::interpreter_wrapper::InterpreterWrapper::CreateWrapperCPPFromFile(char const*, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, std::vector<std::function<void (unsigned long)>, std::allocator<std::function<void (unsigned long)> > > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >) ()
from /usr/lib/python3/dist-packages/tflite_runtime/pywrap_tensorflow_interpreter_wrapper.cpython-37m-aarch64-linux-gnu.so
https://github.com/google-coral/edgetpu/issues/5 0x0000007ff58f08d0 in pybind11::cpp_function::initialize<pybind11_init__pywrap_tensorflow_interpreter_wrapper(pybind11::module&)::{lambda(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, std::vector<std::function<void (unsigned long--Type for more, q to quit, c to continue without paging--
)>, std::allocator<std::function<void (unsigned long)> > > const&)https://github.com/google-coral/edgetpu/pull/2}, tflite::interpreter_wrapper::InterpreterWrapper, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::_cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, std::vector<std::function<void (unsigned long)>, std::allocator<std::function<void (unsigned long)> > > const&, pybind11::name, pybind11::scope, pybind11::sibling>(pybind11_init__pywrap_tensorflow_interpreter_wrapper(pybind11::module&)::{lambda(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, std::vector<std::function<void (unsigned long)>, std::allocator<std::function<void (unsigned long)> > > const&)https://github.com/google-coral/edgetpu/pull/2}&&, tflite::interpreter_wrapper::InterpreterWrapper* ()(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, std::vector<std::function<void (unsigned long)>, std::allocator<std::function<void (unsigned long)> > > const&), pybind11::name const&, pybind11::scope const&, pybind11::sibling const&)::{lambda(pybind11::detail::function_call&)https://github.com/google-coral/edgetpu/issues/3}::_FUN(pybind11::detail::function_call) ()
from /usr/lib/python3/dist-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.cpython-37m-aarch64-linux-gnu.so
https://github.com/google-coral/edgetpu/issues/6 0x0000007ff58e78ec in pybind11::cpp_function::dispatcher(_object, _object*, _object*) ()
from /usr/lib/python3/dist-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.cpython-37m-aarch64-linux-gnu.so
https://github.com/google-coral/edgetpu/pull/7 0x000000000043cf90 in _PyMethodDef_RawFastCallKeywords ()
https://github.com/google-coral/edgetpu/issues/8 0x000000000043d030 in _PyCFunction_FastCallKeywords ()
https://github.com/google-coral/edgetpu/issues/9 0x000000000042b0e4 in _PyEval_EvalFrameDefault ()
https://github.com/google-coral/edgetpu/issues/10 0x00000000004df2bc in _PyEval_EvalCodeWithName ()
https://github.com/google-coral/edgetpu/issues/11 0x000000000043c9bc in _PyFunction_FastCallDict ()
https://github.com/google-coral/edgetpu/issues/12 0x000000000043e104 in _PyObject_Call_Prepend ()
https://github.com/google-coral/edgetpu/issues/13 0x000000000048e078 in ?? ()
https://github.com/google-coral/edgetpu/issues/14 0x0000000000487858 in ?? ()
https://github.com/google-coral/edgetpu/issues/15 0x000000000043d240 in _PyObject_FastCallKeywords ()
--Type for more, q to quit, c to continue without paging--
https://github.com/google-coral/edgetpu/issues/16 0x0000000000425490 in _PyEval_EvalFrameDefault ()
https://github.com/google-coral/edgetpu/issues/17 0x00000000004df2bc in _PyEval_EvalCodeWithName ()
https://github.com/google-coral/edgetpu/issues/18 0x000000000043cb24 in _PyFunction_FastCallKeywords ()
https://github.com/google-coral/edgetpu/issues/19 0x0000000000429e78 in _PyEval_EvalFrameDefault ()
https://github.com/google-coral/edgetpu/issues/20 0x0000000000422914 in ?? ()
https://github.com/google-coral/edgetpu/issues/21 0x0000000000429bac in _PyEval_EvalFrameDefault ()
https://github.com/google-coral/edgetpu/issues/22 0x00000000004df2bc in _PyEval_EvalCodeWithName ()
https://github.com/google-coral/edgetpu/issues/23 0x00000000004df600 in PyEval_EvalCode ()
https://github.com/google-coral/edgetpu/issues/24 0x0000000000512430 in PyRun_FileExFlags ()
https://github.com/google-coral/edgetpu/issues/25 0x000000000051260c in PyRun_SimpleFileExFlags ()
https://github.com/google-coral/edgetpu/issues/26 0x0000000000431be8 in ?? ()
https://github.com/google-coral/edgetpu/issues/27 0x0000000000431e18 in _Py_UnixMain ()
https://github.com/google-coral/edgetpu/issues/28 0x0000007ff7ca6d24 in __libc_start_main () from /lib/aarch64-linux-gnu/libc.so.6
https://github.com/google-coral/edgetpu/issues/29 0x000000000042c3b0 in _start ()

Hi, I got this error message by using gdb, it seems like something wrong with the interpreter but not sure what is the exact problem Hi, @pjpratik 

Could you please look into this issue. Thank you! Hi, I have resolved this issue by changing the package I'm using when inferencing. Thanks. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59604">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59604">No</a>
 > Hi, I have resolved this issue by changing the package I'm using when inferencing. Thanks.

Can you tell me what package?

### 1. System information

- Mendel Linux
- Pycoral package (built in for coral dev board mini)

### 2. Code

Model Training Link:
https://colab.research.google.com/drive/1rk9Pe115dg5Njwh_5g-sh3m7ShVXiNyN

TF Lite Conversion Link:
https://colab.research.google.com/drive/18HPUPVdvBIyPh9z2rd338phJRCQSf7QC#scrollTo=uSYKpoUI0QRU

TF Lite Conversion Code Snippet:
# Load the HDF5 model
model = tf.keras.models.load_model("lung_segmentation_80epochs_avg_pooling_700kparam_aug.hdf5",custom_objects={'dice_coef_loss': dice_coef_loss,
                                      'dice_coef':dice_coef})

converter = tf.lite.TFLiteConverter.from_keras_model(model)
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.representative_dataset = representative_data_gen
# Ensure that if any ops can't be quantized, the converter throws an error
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]
# Set the input and output tensors to uint8 (APIs added in r2.3)
converter.inference_input_type = tf.uint8
converter.inference_output_type = tf.uint8

tflite_model_quant = converter.convert()

# Save the quantized model to disk
with open("new_model_quant.tflite", "wb") as f:
    f.write(tflite_model_quant)

### 3. Failure after conversion

-When model was used to inference in Google Coral Dev Board mini, Segmentation Fault occur

python3 semantic_segmentation.py\
 --model lung_segmentation_quant.tflite \
 --input test.png \
 --keep_aspect_ratio \
 --output ${HOME}/segmentation_result.jpg
