Luxonis OAK-D Lite Deployment Failure

OS: Windows 11
Python version: 3.11
Roboflowoak version: 0.0.11
Device: Luxonis OAK-D Lite

Running script via DepthAI CLI.

Error Message:

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\roboflowoak\__init__.py", line 72, in __init__
    self.dai_pipe = DepthAIPipeline(
                    ^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\roboflowoak\pipe.py", line 87, in __init__
    self.cam_rgb.out.link(self.detection_nn.input)
    ^^^^^^^^^^^^^^^^
AttributeError: 'depthai.node.ColorCamera' object has no attribute 'out'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\roboflowoak\__init__.py", line 104, in __init__
    self.dai_pipe = DepthAIPipeline(
                    ^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\roboflowoak\pipe.py", line 87, in __init__
    self.cam_rgb.out.link(self.detection_nn.input)
    ^^^^^^^^^^^^^^^^
AttributeError: 'depthai.node.ColorCamera' object has no attribute 'out'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\DepthAI\roboflow-projects\face-detection-mik1i\main.py", line 8, in <module>
    rf = RoboflowOak(model="face-detection-mik1i", confidence=0.05, overlap=0.5,
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\roboflowoak\__init__.py", line 123, in __init__
    raise Exception(
Exception: Failure while retrying load weights - does this model, version, api key exist? can you curl api.roboflow.com, and can your device download files from google cloud storage? have you hit your device limit?

Python code:

from roboflowoak import RoboflowOak
import cv2
import time
import numpy as np

if __name__ == '__main__':
    # instantiating an object (rf) with the RoboflowOak module
    rf = RoboflowOak(model="face-detection-mik1i", confidence=0.05, overlap=0.5,
    version="15", api_key="LYXBAkDSueoU3ANtTQBC", rgb=True,
    depth=True, device=None, blocking=True)
    # Running our model and displaying the video output with detections
    while True:
        t0 = time.time()
        # The rf.detect() function runs the model inference
        result, frame, raw_frame, depth = rf.detect(visualize=True)
        predictions = result["predictions"]
        #{
        #    predictions:
        #    [ {
        #        x: (middle),
        #        y:(middle),
        #        width:
        #        height:
        #        depth: ###->
        #        confidence:
        #        class:
        #        mask: {
        #    ]
        #}
        #frame - frame after preprocs, with predictions
        #raw_frame - original frame from your OAK
        #depth - depth map for raw_frame, center-rectified to the center camera

        # timing: for benchmarking purposes
        t = time.time()-t0
        print("INFERENCE TIME IN MS ", 1/t)
        print("PREDICTIONS ", [p.json() for p in predictions])

        # setting parameters for depth calculation
        max_depth = np.amax(depth)
        cv2.imshow("depth", depth/max_depth)
        # displaying the video feed as successive frames
        cv2.imshow("frame", frame)

        # how to close the OAK inference window / stop inference: CTRL+q or CTRL+c
        if cv2.waitKey(1) == ord('q'):
            break

Solving the problem from other topics does not help.

I will be glad if you help me.

We believe the issue was caused by a breaking change to the Depthai API. We have pushed v0.0.12 to PyPi which uses the updated API. You can update with pip install roboflowoak==0.0.12.

Hi @trevorhlynn -

Just jumping on this thread as I’ve been experiencing identical problems with inferencing on the Oak device. I loaded up 0.0.12 to do a quick check, but am now encountering X_LINK_ERROR runtime errors.

(Just some very quick initial feedback, and I haven’t looked into it in any depth. Will be interested to hear others feedback with 0.0.12 … could very well be me).

Thanks for looking into this issue for us Oak users.

Larry

Thanks for the quick solution! :clap:

When running the script unchanged, the following error appears:

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\DepthAI\roboflow-projects\face-detection-mik1i\main.py", line 15, in <module>
    result, frame, raw_frame, depth = rf.detect(visualize=True)
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: RoboflowOak.detect() got an unexpected keyword argument 'visualize'

When rf.detect(visualize=True) => rf.detect() is removed, the script starts and runs.

After a reboot of my RPi4 (also removing visualize=True), all appears to be working better for me also … inferencing now looking fine.

Thanks much,
Larry

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.