Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault when running example script or custom models on usb coral #821

Closed
Skillnoob opened this issue Jan 22, 2024 · 2 comments
Closed
Labels
comp:model Model related isssues comp:thirdparty Thirdparty related issues Hardware:USB Accelerator Coral USB Accelerator issues subtype:ubuntu/linux Ubuntu/Linux Build/installation issues type:bug Bug

Comments

@Skillnoob
Copy link

Skillnoob commented Jan 22, 2024

Description

After running the example script or ultralytics example i get a segmentation fault.
I followed the installation instructions for the USB coral and did so multiple times making sure i had nothing wrong.
It worked previously (few months ago) but does not anymore.
Video of it working correctly:

2023-09-16_13-27-48_Trim.mp4

Some information about the setup:
Os: Rasberry Pi Os Bullseye 64bit / Bookworm 64bit
Device: Rasberry Pi 4B 2GB / Raspberry Pi 5 8GB
tflite_runtime version: 2.10 until latest have been tested
Python: 3.9.2 (Pi 4B) / 3.11.2 (Pi 5) (3.7.16 and 3.9.18 have also been tested through conda)

Ways to reproduce the issue:
Run the detection example script from here.

Or follow these steps for a custom model:

$ pip install ultralytics

$ yolo export model=yolov8n.pt format=edgetpu

$ yolo detect val model=yolov8n_saved_model/yolov8n_full_integer_quant_edgetpu.tflite data=coco128.yaml batch=1
Click to expand!

Issue Type

Bug

Operating System

Linux

Coral Device

USB Accelerator

Other Devices

Rapsberry Pi 4

Programming Language

Python 3.9, Other

Relevant Log Output

When run through gdb:

Starting program: /usr/bin/python3 detect_image.py \
  --model models/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite \
  --labels models/coco_labels.txt \
  --input images/grace_hopper.bmp \
  --output images/grace_hopper_processed.bmp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ff547e1c0 (LWP 4159)]
[New Thread 0x7ff4c7d1c0 (LWP 4160)]
[New Thread 0x7ff047c1c0 (LWP 4161)]
[New Thread 0x7fec6ee1c0 (LWP 4162)]
[Thread 0x7fec6ee1c0 (LWP 4162) exited]
[New Thread 0x7fec6ee1c0 (LWP 4163)]
[Thread 0x7fec6ee1c0 (LWP 4163) exited]
[New Thread 0x7fec6ee1c0 (LWP 4164)]
[New Thread 0x7febeed1c0 (LWP 4165)]
[New Thread 0x7feb6ec1c0 (LWP 4166)]
[Thread 0x7feb6ec1c0 (LWP 4166) exited]
[Thread 0x7febeed1c0 (LWP 4165) exited]
[New Thread 0x7febeed1c0 (LWP 4167)]
[New Thread 0x7feb6ec1c0 (LWP 4168)]
[Thread 0x7feb6ec1c0 (LWP 4168) exited]
[Thread 0x7febeed1c0 (LWP 4167) exited]
[New Thread 0x7febeed1c0 (LWP 4185)]
[New Thread 0x7feb6ec1c0 (LWP 4186)]
[New Thread 0x7feaeeb1c0 (LWP 4187)]

Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
0x0000007fecb89350 in tflite::Subgraph::OpInit(TfLiteRegistration const&, char const*, unsigned long) () from /home/pi/.local/lib/python3.9/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so



Using backtrace from gdb:

Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
0x0000007fecb89350 in tflite::Subgraph::OpInit(TfLiteRegistration const&, char const*, unsigned long) () from /home/pi/.local/lib/python3.9/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so
(gdb) backtrace
#0  0x0000007fecb89350 in tflite::Subgraph::OpInit(TfLiteRegistration const&, char const*, unsigned long) () from /home/pi/.local/lib/python3.9/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so
#1  0x0000007fecb8c4dc in tflite::Subgraph::AddNodeWithParameters(std::vector<int, std::allocator<int> > const&, std::vector<int, std::allocator<int> > const&, std::vector<int, std::allocator<int> > const&, char const*, unsigned long, void*, TfLiteRegistration const*, int*) () from /home/pi/.local/lib/python3.9/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so
#2  0x0000007fecb8dc9c in tflite::Subgraph::ReplaceNodeSubsetsWithDelegateKernels(TfLiteRegistration, TfLiteIntArray const*, TfLiteDelegate*) ()
   from /home/pi/.local/lib/python3.9/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so
#3  0x0000007fecb8df00 in tflite::Subgraph::ReplaceNodeSubsetsWithDelegateKernels(TfLiteContext*, TfLiteRegistration, TfLiteIntArray const*, TfLiteDelegate*) ()
   from /home/pi/.local/lib/python3.9/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so
#4  0x0000007fec7cde24 in ?? () from /lib/aarch64-linux-gnu/libedgetpu.so.1
#5  0x0000007fecb8d668 in tflite::Subgraph::ModifyGraphWithDelegate(TfLiteDelegate*) () from /home/pi/.local/lib/python3.9/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so
#6  0x0000007fecc3d034 in tflite::Interpreter::ModifyGraphWithDelegateImpl(TfLiteDelegate*) () from /home/pi/.local/lib/python3.9/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so
#7  0x0000007fecb6c8a8 in tflite::interpreter_wrapper::InterpreterWrapper::ModifyGraphWithDelegate(TfLiteDelegate*) () from /home/pi/.local/lib/python3.9/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so
#8  0x0000007fecb73514 in pybind11::cpp_function::initialize<pybind11_init__pywrap_tensorflow_interpreter_wrapper(pybind11::module_&)::{lambda(tflite::interpreter_wrapper::InterpreterWrapper&, unsigned long)#24}, pybind11::object, tflite::interpreter_wrapper::InterpreterWrapper&, unsigned long, pybind11::name, pybind11::is_method, pybind11::sibling, char [60]>(pybind11_init__pywrap_tensorflow_interpreter_wrapper(pybind11::module_&)::{lambda(tflite::interpreter_wrapper::InterpreterWrapper&, unsigned long)#24}&&, pybind11::object (*)(tflite::interpreter_wrapper::InterpreterWrapper&, unsigned long), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&, char const (&) [60])::{lambda(pybind11::detail::function_call&)#3}::_FUN(pybind11::detail::function_call&) () from /home/pi/.local/lib/python3.9/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so
#9  0x0000007fecb822d0 in pybind11::cpp_function::dispatcher(_object*, _object*, _object*) () from /home/pi/.local/lib/python3.9/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so
#10 0x00000000004cac54 in ?? ()
#11 0x00000000004a5300 in _PyObject_MakeTpCall ()
#12 0x00000000004c6cc8 in ?? ()
#13 0x000000000049c258 in _PyEval_EvalFrameDefault ()
#14 0x00000000004964f8 in ?? ()
#15 0x00000000004b1d20 in _PyFunction_Vectorcall ()
#16 0x00000000004c1d88 in ?? ()
#17 0x00000000004a5180 in _PyObject_MakeTpCall ()
#18 0x000000000049ccf4 in _PyEval_EvalFrameDefault ()
#19 0x00000000004b1a48 in _PyFunction_Vectorcall ()
#20 0x0000000000498064 in _PyEval_EvalFrameDefault ()
#21 0x0000000000496b1c in ?? ()
#22 0x00000000004b1ca0 in _PyFunction_Vectorcall ()
#23 0x0000000000498064 in _PyEval_EvalFrameDefault ()
#24 0x00000000004964f8 in ?? ()
#25 0x0000000000496290 in _PyEval_EvalCodeWithName ()
#26 0x00000000005976fc in PyEval_EvalCode ()
#27 0x00000000005c850c in ?? ()
#28 0x00000000005c2520 in ?? ()
#29 0x00000000005c8458 in ?? ()
#30 0x00000000005c7c38 in PyRun_SimpleFileExFlags ()
#31 0x00000000005b7afc in Py_RunMain ()
#32 0x0000000000587638 in Py_BytesMain ()
#33 0x0000007ff7d00e18 in __libc_start_main (main=0x587538 <_start+56>, argc=10, argv=0x7ffffff118, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=<optimized out>) at ../csu/libc-start.c:308
#34 0x0000000000587534 in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
@google-coral-bot google-coral-bot bot added comp:model Model related isssues comp:thirdparty Thirdparty related issues Hardware:USB Accelerator Coral USB Accelerator issues subtype:ubuntu/linux Ubuntu/Linux Build/installation issues type:bug Bug labels Jan 22, 2024
@Skillnoob
Copy link
Author

This is now resolved due to the amazing work by feranic in #812 .

Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:model Model related isssues comp:thirdparty Thirdparty related issues Hardware:USB Accelerator Coral USB Accelerator issues subtype:ubuntu/linux Ubuntu/Linux Build/installation issues type:bug Bug
Projects
None yet
Development

No branches or pull requests

1 participant