luxonis / depthai-python

DepthAI Python Library
MIT License
362 stars 192 forks source link

examples/stereo_depth_video.py segfault #520

Open Petrox opened 2 years ago

Petrox commented 2 years ago
$ lsb_release  -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:    20.04
Codename:   focal
depthai-python/examples$ ./install_requirements.py 
pip 22.0.3 from /home/petros/.local/lib/python3.8/site-packages/pip (python 3.8)
Requirement already satisfied: pip in /home/petros/.local/lib/python3.8/site-packages (22.0.3)
Requirement already satisfied: pyyaml in /home/petros/.local/lib/python3.8/site-packages (6.0)
Requirement already satisfied: requests in /home/petros/.local/lib/python3.8/site-packages (2.26.0)
Collecting requests
  Using cached requests-2.27.1-py2.py3-none-any.whl (63 kB)
Requirement already satisfied: numpy in /home/petros/.local/lib/python3.8/site-packages (1.22.2)
Requirement already satisfied: opencv-python in /home/petros/.local/lib/python3.8/site-packages (4.5.1.48)
Collecting opencv-python
  Using cached opencv_python-4.5.5.62-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (60.4 MB)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3/dist-packages (from requests) (1.25.8)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests) (2019.11.28)
Requirement already satisfied: charset-normalizer~=2.0.0 in /home/petros/.local/lib/python3.8/site-packages (from requests) (2.0.10)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests) (2.8)
Installing collected packages: requests, opencv-python
  Attempting uninstall: requests
    Found existing installation: requests 2.26.0
    Uninstalling requests-2.26.0:
      Successfully uninstalled requests-2.26.0
  Attempting uninstall: opencv-python
    Found existing installation: opencv-python 4.5.1.48
    Uninstalling opencv-python-4.5.1.48:
      Successfully uninstalled opencv-python-4.5.1.48
Successfully installed opencv-python-4.5.5.62 requests-2.27.1
Collecting depthai
  Using cached depthai-2.15.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.9 MB)
Installing collected packages: depthai
  Attempting uninstall: depthai
    Found existing installation: depthai 2.15.0.0
    Uninstalling depthai-2.15.0.0:
      Successfully uninstalled depthai-2.15.0.0
Successfully installed depthai-2.15.0.0
################|| Downloading calibration-sample ||################

========== Retrieving /home/petros/proj/depthai-python/examples/models/depthai_calib.json from the cache

========== Retrieving /home/petros/proj/depthai-python/examples/models/depthai_v5.calib from the cache

========== Retrieving /home/petros/proj/depthai-python/examples/models/BW1098OBC.json from the cache

################|| Downloading concat-model ||################

========== Retrieving /home/petros/proj/depthai-python/examples/models/concat_openvino_2021.4_6shave.blob from the cache

################|| Downloading mobilenet-ssd ||################

========== Retrieving /home/petros/proj/depthai-python/examples/models/mobilenet-ssd_openvino_2021.4_6shave.blob from the cache

========== Retrieving /home/petros/proj/depthai-python/examples/models/mobilenet-ssd_openvino_2021.4_5shave.blob from the cache

========== Retrieving /home/petros/proj/depthai-python/examples/models/mobilenet-ssd_openvino_2021.4_8shave.blob from the cache

################|| Downloading normalization-model ||################

========== Retrieving /home/petros/proj/depthai-python/examples/models/normalize_openvino_2021.4_4shave.blob from the cache

################|| Downloading person-detection-retail-0013 ||################

========== Retrieving /home/petros/proj/depthai-python/examples/models/person-detection-retail-0013_openvino_2021.4_7shave.blob from the cache

################|| Downloading stereo-dataset ||################

========== Retrieving /home/petros/proj/depthai-python/examples/models/dataset.zip from the cache

========== Unpacking /home/petros/proj/depthai-python/examples/models/dataset.zip

################|| Downloading tiny-yolo ||################

========== Retrieving /home/petros/proj/depthai-python/examples/models/yolo-v3-tiny-tf_openvino_2021.4_6shave.blob from the cache

========== Retrieving /home/petros/proj/depthai-python/examples/models/yolo-v4-tiny-tf_openvino_2021.4_6shave.blob from the cache

################|| Downloading video-resources ||################

========== Retrieving /home/petros/proj/depthai-python/examples/models/construction_vest.mp4 from the cache
depthai-python/examples/StereoDepth$ ./stereo_depth_video.py
StereoDepth config options:
    Resolution:   (1280, 720)
    Left-Right check:   False
    Extended disparity: False
    Subpixel:           False
    Median filtering:   MedianFilter.KERNEL_7x7
    Generating mesh files:   False
    Outputting mesh files to:   None
Creating Stereo Depth pipeline
Creating DepthAI device
[1844301031B60F1300] [3.898] [MonoCamera(1)] [error] OV7251 only supports THE_480_P/THE_400_P resolutions, defaulting to THE_480_P
[1844301031B60F1300] [3.898] [MonoCamera(0)] [error] OV7251 only supports THE_480_P/THE_400_P resolutions, defaulting to THE_480_P
Stack trace (most recent call last):
#16   Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in 
#15   Object "python3", at 0x5fb12d, in _start
#14   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7fb4cd4af0b2, in __libc_start_main
#13   Object "python3", at 0x6b7c8c, in Py_BytesMain
#12   Object "python3", at 0x6b7901, in Py_RunMain
#11   Object "python3", at 0x67f376, in PyRun_SimpleFileExFlags
#10   Object "python3", at 0x67efd0, in 
#9    Object "python3", at 0x67ef2e, in 
#8    Object "python3", at 0x67eeb0, in 
#7    Object "python3", at 0x68db16, in PyEval_EvalCode
#6    Object "python3", at 0x5696d9, in _PyEval_EvalCodeWithName
#5    Object "python3", at 0x5703e5, in _PyEval_EvalFrameDefault
#4    Object "python3", at 0x50b4a6, in 
#3    Object "python3", at 0x5f6a45, in _PyObject_MakeTpCall
#2    Object "python3", at 0x5f5e78, in PyCFunction_Call
#1    Object "/home/petros/.local/lib/python3.8/site-packages/depthai.cpython-38-x86_64-linux-gnu.so", at 0x7fb4ae2aee56, in 
#0    Object "/home/petros/.local/lib/python3.8/site-packages/depthai.cpython-38-x86_64-linux-gnu.so", at 0x7fb4ae35cffc, in 
Segmentation fault (Address not mapped to object [0x10])
Segmentation fault

Computer: corei7-7700hq with lots of ram and IO, no resource starving.

The disparity image was low quality, displayed "ghosts" (non existent close objects which were visible when I moved the camera (oak-d-lite), then suddenly segfault. (which is not an acceptable way to handle any issues)

chris-piekarski commented 2 years ago

I am getting this same error on one of my production boxes using OAK-D-POE using standard center RGB camera. For whatever reason that one box throws it after ~10-90 minutes of running continuously. However, another box I upgraded using the same hardware (PC & cameras) has been running solid for 3 days on the 2.15.0 release.

Stack trace (most recent call last):

24 Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in

23 Object "python3", at 0x5fb12d, in _start

22 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f0f998570b2, in __libc_start_main

21 Object "python3", at 0x6b7c8c, in Py_BytesMain

20 Object "python3", at 0x6b7901, in Py_RunMain

19 Object "python3", at 0x67f376, in PyRun_SimpleFileExFlags

18 Object "python3", at 0x67efd0, in

17 Object "python3", at 0x67ef2e, in

16 Object "python3", at 0x67eeb0, in

15 Object "python3", at 0x68db16, in PyEval_EvalCode

14 Object "python3", at 0x5696d9, in _PyEval_EvalCodeWithName

13 Object "python3", at 0x56b5df, in _PyEval_EvalFrameDefault

12 Object "python3", at 0x5f6225, in _PyFunction_Vectorcall

11 Object "python3", at 0x56b7c8, in _PyEval_EvalFrameDefault

10 Object "python3", at 0x5a9122, in

9 Object "python3", at 0x5f6402, in _PyFunction_Vectorcall

8 Object "python3", at 0x5696d9, in _PyEval_EvalCodeWithName

7 Object "python3", at 0x5703e5, in _PyEval_EvalFrameDefault

6 Object "python3", at 0x50ac5d, in

5 Object "python3", at 0x5703e5, in _PyEval_EvalFrameDefault

4 Object "python3", at 0x50b4a6, in

3 Object "python3", at 0x5f6a45, in _PyObject_MakeTpCall

2 Object "python3", at 0x5f5e78, in PyCFunction_Call

1 Object "/usr/local/lib/python3.8/dist-packages/depthai.cpython-38-x86_64-linux-gnu.so", at 0x7f0f777ade56, in

0 Object "/usr/local/lib/python3.8/dist-packages/depthai.cpython-38-x86_64-linux-gnu.so", at 0x7f0f7785bffc, in

themarpe commented 2 years ago

Sorry for the issues at hand @Petrox @chris-piekarski

@Petrox how long after the segfault arrises on the example you've ran? Is it immediate or happens after some time of running? Also can you share the low quality disparity images and in what scenario were they taken? (CC: @Erol444 on disparity images) EDIT: I think those should be available here: https://github.com/luxonis/depthai-python/issues/521

@chris-piekarski Were both boxes running version 2.15.0? If that is the case, do you happen to know any other differences that might be at play here.

In any case, we are still on the hunt to track down some additional stability issues, which I think could be pertinent here in both cases. We'll keep you updated

chris-piekarski commented 2 years ago

Yes both boxes running 2.15.0 @themarpe One that doesn't fail: using mono 720p with only crop manip at 15 fps NN One that fails: using RGB with manip crop and rotate at 30 fps NN

themarpe commented 2 years ago

We'll take a further look into this and get back