question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

depthai_demo.py fails with exception and told me to report to developers

See original GitHub issue

Running depthai_demo.py with face-detection-retail-0004 for 12 shaves throws exception and tells me to report to developers.

Setup

  • Microsoft Windows [Version 10.0.19044.1348]
  • depthai repo at main currently d51f032df0a100f2879ca7318da333fb779cb6ec
  • python 3.9.5 64-bit

Repro

  1. Follow instructions from https://docs.luxonis.com/en/latest/pages/tutorials/first_steps/#setup
  2. activate the venv
  3. Run python depthai_demo.py
  4. see the default model run correctly
  5. change model to face-detection-retail-0004
  6. click apply restart
  7. restart depthai_demo.py if the app completely exits
  8. change model to face-detection-retail-0004 again if the app exited
  9. see face model working
  10. change shaves to 12
  11. click apply restart
  12. restart depthai_demo.py if the app completely exits
  13. change model to face-detection-retail-0004 again if the app exited
  14. click apply restart
  15. download happens in background… then…

Result

App throws exception. Tells me to report to developers. Windows dialog also appears. image

(venv) C:\njs\depthai>python depthai_demo.py
Using depthai module from:  C:\njs\depthai\venv\lib\site-packages\depthai.cp39-win_amd64.pyd
Depthai version installed:  2.13.0.0
Setting up demo...
Available devices:
[0] 14442C10C1A1C6D200 [X_LINK_UNBOOTED]
USB Connection speed: UsbSpeed.SUPER
Stopping demo...
=== TOTAL FPS ===
[color]: 28.2
[nnInput]: 23.7
[depthRaw]: 24.9
[depth]: 24.9
[left]: 27.0
[rectifiedLeft]: 23.6
Setting up demo...
[right]: 26.4
Available devices:
[rectifiedRight]: 24.6
[nn]: 23.6
[0] 14442C10C1A1C6D200 [X_LINK_UNBOOTED]
USB Connection speed: UsbSpeed.SUPER
Downloading C:\Users\dale\.cache\blobconverter\face-detection-retail-0004_openvino_2021.4_12shave.blob...
[==================================================]
Done
[14442C10C1A1C6D200] [15.506] [SpatialDetectionNetwork(14)] [warning] Network compiled for 12 shaves, maximum available 13, compiling for 6 shaves likely will yield in better performance
[14442C10C1A1C6D200] [15.680] [system] [critical] Fatal error. Please report to developers. Log: 'ResourceLocker' '162'
Stopping demo...
=== TOTAL FPS ===
[color]: 30.5
[left]: 0.0
[right]: 0.0
  File "C:\njs\depthai\depthai_demo.py", line 548, in run
    self.instance.run_all(self.conf)
  File "C:\njs\depthai\depthai_demo.py", line 61, in run_all
    self.run()
  File "C:\njs\depthai\depthai_demo.py", line 256, in run
    self.loop()
  File "C:\njs\depthai\depthai_demo.py", line 283, in loop
    self._pv.prepareFrames(callback=self.onNewFrame)
  File "c:\njs\depthai\depthai_sdk\src\depthai_sdk\managers\preview_manager.py", line 113, in prepareFrames
    packet = queue.tryGet()
Communication exception - possible device error/misconfiguration. Original message 'Couldn't read data from stream: 'color' (X_LINK_ERROR)'

Log
log_system_information.zip

Expected

No errors and 12 shaves being used.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
diablodalecommented, Nov 25, 2021

🤪What you said @alex-luxonis 😉

I have much to learn about the onboard capabilities of OAK: NN, hardware threads, shaves, etc. Not only the tech, but the “feel” of the tech. This demo py looks like an excellent place to experiment and learn – hence – me trying different shave counts to see how it affects NN fps, latency, or “feel”.

The demo GUI did caution me that it probably runs better with 6 shaves. 🙉

Is your fuzz testing in place? Randomly choosing config options and then run and see what breaks. Good opportunity for automation. a few rand(), a run(), and watch for smoke. 😂

2reactions
szabi-luxoniscommented, Nov 25, 2021

The issue is not related to the above-mentioned number of threads, it’s an internal resource allocation issue in firmware when setRuntimeModeSwitch is enabled. Will issue a fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting - DepthAI documentation - Luxonis
For USB OAK cameras, DepthAI can throw an error code like X_LINK_COMMUNICATION_NOT_OPEN or X_LINK_ERROR , which is usually a sign of a bad...
Read more >
Profile for GitHub - Linknovate
I believe this article will interest developers trying to improve the interpreter performance of dynamic programming languages (e.g., CPython developers). I ...
Read more >
depthai from luxonis - GithubHelp
depthai_ai.cmd not xlink success depthai: Error initalizing xlink; Traceback (most recent call last): File "test_cnn.py", line 43, in <module> nnet_packets, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found