Roboflowoak error: RuntimeWarning: divide by zero encountered in true_divide


I’m having a problem using roboflowoak. It is similar, but a bit different to the below post, so I’ve started a new thread
Basically, the DepthAI window appears momentarily, then disappears and I get the following error

I’d appreciate any help- thank you

Pip install RoboFlowOak error - Community Help - Roboflow

(roboflowoak_env) ub@ub-HP-Z620-Workstation:~/python/roboflowoak$ python
/home/ub/python/roboflowoak/roboflowoak_env/lib/python3.8/site-packages/roboflowoak/ RuntimeWarning: divide by zero encountered in true_divide
  return 441.25 * 7.5 / disparity
INFERENCE TIME IN MS  3.717132042564015
PREDICTIONS  [] RuntimeWarning: invalid value encountered in true_divide
  cv2.imshow("depth", depth/max_depth)
INFERENCE TIME IN MS  45.57886615302696
INFERENCE TIME IN MS  44.69252408149348
INFERENCE TIME IN MS  46.14449639694153
INFERENCE TIME IN MS  45.771356235540615
INFERENCE TIME IN MS  45.286056706039865
INFERENCE TIME IN MS  33.624640248839576
PREDICTIONS  [{'x': 206.0, 'y': 211.5, 'width': 366, 'height': 375, 'depth': 127.28365384615384, 'confidence': 0.05377197265625, 'class': 'roller'}]
INFERENCE TIME IN MS  39.08768463724896
PREDICTIONS  [{'x': 206.0, 'y': 213.0, 'width': 378, 'height': 378, 'depth': 122.56944444444444, 'confidence': 0.058502197265625, 'class': 'roller'}]
INFERENCE TIME IN MS  38.608429908778774
PREDICTIONS  [{'x': 206.0, 'y': 211.0, 'width': 382, 'height': 376, 'depth': 122.56944444444444, 'confidence': 0.06622314453125, 'class': 'roller'}]
INFERENCE TIME IN MS  21.963271525745018
PREDICTIONS  [{'x': 207.0, 'y': 212.5, 'width': 388, 'height': 391, 'depth': 143.8858695652174, 'confidence': 0.1002197265625, 'class': 'roller'}]
INFERENCE TIME IN MS  39.86980988593156
PREDICTIONS  [{'x': 207.5, 'y': 212.5, 'width': 387, 'height': 391, 'depth': 137.890625, 'confidence': 0.10791015625, 'class': 'roller'}]
Traceback (most recent call last):
  File "", line 15, in <module>
    result, frame, raw_frame, depth = rf.detect(visualize=True)
  File "/home/ub/python/roboflowoak/roboflowoak_env/lib/python3.8/site-packages/roboflowoak/", line 63, in detect
    ret = self.dai_pipe.get()         
  File "/home/ub/python/roboflowoak/roboflowoak_env/lib/python3.8/site-packages/roboflowoak/", line 142, in get
    frame, frame_raw = self.process_frame(detections, in_rgb)
  File "/home/ub/python/roboflowoak/roboflowoak_env/lib/python3.8/site-packages/roboflowoak/", line 181, in process_frame
    class_color = self.colors[detection[4]].strip("#")
KeyError: 'moxy'

Try using the barrel plug for additional power to Oak. This cures some problems.

Mine has said “divide by zero error” also but this hasn’t stopped operation.

thanks Russ- But I am already using the barrel plug