Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Segmentation fault when running on RASPI4 w/ Coral #43

Open
iCUE-Solutions opened this issue Nov 24, 2020 · 13 comments
Open

Segmentation fault when running on RASPI4 w/ Coral #43

iCUE-Solutions opened this issue Nov 24, 2020 · 13 comments
Assignees
Labels
comp:thirdparty Thirdparty related issues type:bug Bug

Comments

@iCUE-Solutions
Copy link

iCUE-Solutions commented Nov 24, 2020

Is this example supposed to also run on RASPI 4 or am I just wasting my time?

Independent of the model used I get this error.

Loading model: models/mobilenet/posenet_mobilenet_v1_075_481_641_quant_decoder_edgetpu.tflite
[1] 18593 segmentation fault python3 anonymizer.py

@Namburger
Copy link
Contributor

Hello, this should works on the pi4, however we recently deprecated the edgetpu API and is actively workiong on a fix.
For now, please use my fork: https://github.com/Namburger/project-posenet
More details here:
#42 (comment)

@Namburger Namburger added API bug Something isn't working labels Dec 3, 2020
@hjonnala hjonnala added comp:thirdparty Thirdparty related issues type:bug Bug and removed bug Something isn't working API labels Aug 9, 2021
@andrewtvuong
Copy link

andrewtvuong commented Sep 2, 2021

I have this same problem

➜ project-posenet git:(master) python3 pose_camera.py --res 480x360
/home/pi/workspace/project-posenet/gstreamer.py:15: PyGIWarning: Gst was imported without specifying a version first. Use gi.require_version('Gst', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GLib, GObject, Gst, GstBase, GstVideo, Gtk
/home/pi/workspace/project-posenet/gstreamer.py:15: PyGIWarning: GstBase was imported without specifying a version first. Use gi.require_version('GstBase', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GLib, GObject, Gst, GstBase, GstVideo, Gtk
/home/pi/workspace/project-posenet/gstreamer.py:15: PyGIWarning: GstVideo was imported without specifying a version first. Use gi.require_version('GstVideo', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GLib, GObject, Gst, GstBase, GstVideo, Gtk
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
/home/pi/workspace/project-posenet/gstreamer.py:15: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import GLib, GObject, Gst, GstBase, GstVideo, Gtk
Loading model: models/mobilenet/posenet_mobilenet_v1_075_353_481_quant_decoder_edgetpu.tflite
Gstreamer pipeline: v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=30/1 ! decodebin ! videoflip video-direction=identity ! tee name=t
t. ! queue max-size-buffers=1 leaky=downstream ! videoconvert ! freezer name=freezer ! rsvgoverlay name=overlay
! videoconvert ! autovideosink
t. ! queue max-size-buffers=1 leaky=downstream ! videoconvert ! videoscale ! video/x-raw,width=470,height=353 ! videobox name=box autocrop=true
! video/x-raw,format=RGB,width=481,height=353 ! appsink name=appsink emit-signals=true max-buffers=1 drop=true

[1] 17780 segmentation fault python3 pose_camera.py --res 480x360

Does this mean the fix is not ready? @Namburger

@hjonnala
Copy link

hjonnala commented Sep 2, 2021

@andrewtvuong I am able to run this command python3 pose_camera.py --res 480x360 on RASPI4 without any error.

I don't see these lines on cmd:

Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused

@andrewtvuong
Copy link

andrewtvuong commented Sep 2, 2021

Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused

@hjonnala I'm thinking this is due to me running the setup as headless. At the same time, I am also seeing seg fault as @iCUE-Solutions and some other folks in related issues #42 (comment)

@hjonnala
Copy link

hjonnala commented Sep 2, 2021

can you share output of following command:

python3 -c 'from pycoral.utils.edgetpu import get_runtime_version; print(get_runtime_version())'

@andrewtvuong
Copy link

python3 -c 'from pycoral.utils.edgetpu import get_runtime_version; print(get_runtime_version())'
produces
BuildLabel(COMPILER=6.3.0 20170516,DATE=redacted,TIME=redacted), RuntimeVersion(14)

@hjonnala
Copy link

hjonnala commented Sep 2, 2021

can you try python3 simple_pose.py and see if you are getting any segmentation fault?

@andrewtvuong
Copy link

andrewtvuong commented Sep 2, 2021

Thanks
python3 simple_pose.py works well
python3 anonymizer.py

/home/pi/workspace/project-posenet/gstreamer.py:15: PyGIWarning: Gst was imported without specifying a version first. Use gi.require_version('Gst', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GLib, GObject, Gst, GstBase, GstVideo, Gtk
/home/pi/workspace/project-posenet/gstreamer.py:15: PyGIWarning: GstBase was imported without specifying a version first. Use gi.require_version('GstBase', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GLib, GObject, Gst, GstBase, GstVideo, Gtk
/home/pi/workspace/project-posenet/gstreamer.py:15: PyGIWarning: GstVideo was imported without specifying a version first. Use gi.require_version('GstVideo', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GLib, GObject, Gst, GstBase, GstVideo, Gtk
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
/home/pi/workspace/project-posenet/gstreamer.py:15: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import GLib, GObject, Gst, GstBase, GstVideo, Gtk
Loading model: models/mobilenet/posenet_mobilenet_v1_075_481_641_quant_decoder_edgetpu.tflite
Gstreamer pipeline: v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=30/1 ! decodebin ! videoflip video-direction=identity ! tee name=t
t. ! queue max-size-buffers=1 leaky=downstream ! videoconvert ! freezer name=freezer ! rsvgoverlay name=overlay
! videoconvert ! autovideosink
t. ! queue max-size-buffers=1 leaky=downstream ! videoconvert ! videoscale ! video/x-raw,width=641,height=480 ! videobox name=box autocrop=true
! video/x-raw,format=RGB,width=641,height=481 ! appsink name=appsink emit-signals=true max-buffers=1 drop=true

[1] 1325 segmentation fault python3 anonymizer.py

python3 posenet_engine_test.py

FAIL: test_model_accuracy (main.PoseEngineAccuracyTest)
x----------------------------------------------------------------------
Traceback (most recent call last):
File "posenet_engine_test.py", line 52, in test_model_accuracy
model_keypoint.point[0], reference_keypoint.point[0], delta=pixel_delta)
AssertionError: 544.0 != 536.91327 within 4.0 delta (7.086729999999989 difference)

x----------------------------------------------------------------------
Ran 1 test in 3.234s

FAILED (failures=1)

python3 test_utils.py

F driver/usb/usb_driver.cc:857] transfer on tag 2 failed. Abort. Deadline exceeded: USB transfer error 2 [LibUsbDataOutCallback]
[1] 1552 abort python3 test_utils.py

EDIT:
very weird, running python3 simple_pose.py after the above sequence now fails with following error:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 160, in load_delegate
delegate = Delegate(library, options)
File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 119, in init
raise ValueError(capture.message)
ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "simple_pose.py", line 27, in
'models/mobilenet/posenet_mobilenet_v1_075_481_641_quant_decoder_edgetpu.tflite')
File "/home/pi/workspace/project-posenet/pose_engine.py", line 79, in init
edgetpu_delegate = load_delegate(EDGETPU_SHARED_LIB)
File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 163, in load_delegate
library, str(e)))
ValueError: Failed to load delegate from libedgetpu.so.1

@hjonnala
Copy link

hjonnala commented Sep 2, 2021

please check this: https://coral.ai/docs/notes/build-coral/#failed-to-load-delegate-from-libedgetpuso1 to resolve ValueError: Failed to load delegate from libedgetpu.so.1

@hjonnala
Copy link

hjonnala commented Sep 2, 2021

I am not having any segmentation issue with any script. I have python 3.7.3.

what is your
python version?
tflite_runtime version?
pycoral version?

@andrewtvuong
Copy link

Python 3.7.3
tflite-runtime 2.5.0.post1
pycoral 2.0.0

@hjonnala
Copy link

hjonnala commented Sep 2, 2021

Hmm.. I have same config.. can you try without headless?

@andrewtvuong
Copy link

andrewtvuong commented Sep 3, 2021

with monitor

python3 pose_camera.py
/home/pi/workspace/project-posenet/gstreamer.py:15: PyGIWarning: Gst was imported without specifying a version first. Use gi.require_version('Gst', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GLib, GObject, Gst, GstBase, GstVideo, Gtk
/home/pi/workspace/project-posenet/gstreamer.py:15: PyGIWarning: GstBase was imported without specifying a version first. Use gi.require_version('GstBase', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GLib, GObject, Gst, GstBase, GstVideo, Gtk
/home/pi/workspace/project-posenet/gstreamer.py:15: PyGIWarning: GstVideo was imported without specifying a version first. Use gi.require_version('GstVideo', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GLib, GObject, Gst, GstBase, GstVideo, Gtk
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
/home/pi/workspace/project-posenet/gstreamer.py:15: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import GLib, GObject, Gst, GstBase, GstVideo, Gtk
Loading model: models/mobilenet/posenet_mobilenet_v1_075_481_641_quant_decoder_edgetpu.tflite
Gstreamer pipeline: v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=30/1 ! decodebin ! videoflip video-direction=identity ! tee name=t
t. ! queue max-size-buffers=1 leaky=downstream ! videoconvert ! freezer name=freezer ! rsvgoverlay name=overlay
! videoconvert ! autovideosink
t. ! queue max-size-buffers=1 leaky=downstream ! videoconvert ! videoscale ! video/x-raw,width=641,height=480 ! videobox name=box autocrop=true
! video/x-raw,format=RGB,width=641,height=481 ! appsink name=appsink emit-signals=true max-buffers=1 drop=true

Error: gst-resource-error-quark: GStreamer encountered a general resource error. (1): gstkmssink.c(1530): gst_kms_sink_show_frame (): /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstKMSSink:autovideosink0-actual-sink-kms:
drmModeSetPlane failed: Permission denied (-13)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
comp:thirdparty Thirdparty related issues type:bug Bug
Projects
None yet
Development

No branches or pull requests

5 participants