Closed dsoltis3 closed 3 weeks ago
Same problem on Windows 11, same pink and red flashing rectangles. I'm running from DepthAI-setup-v3.5.0.exe, which installed depthai-viewer 0.2.2 and NumPy 2.0.0.
Console repeatedly prints:
WARNING:root:Ignoring rerun log call: Traceback (most recent call last):
File "C:\Users\bill\AppData\Local\Programs\DepthAI\venv\lib\site-packages\depthai_viewer\log\log_decorator.py", line 35, in wrapper
return func(*args, **kwargs)
File "C:\Users\bill\AppData\Local\Programs\DepthAI\venv\lib\site-packages\depthai_viewer\log\rects.py", line 163, in log_rects
colors = _normalize_colors(colors)
File "C:\Users\bill\AppData\Local\Programs\DepthAI\venv\lib\site-packages\depthai_viewer\log\__init__.py", line 55, in _normalize_colors
colors_array = np.array(colors, copy=False)
ValueError: Unable to avoid copy while creating an array as requested.
If using `np.array(obj, copy=False)` replace it with `np.asarray(obj)` to allow a copy when needed (no behavior change in NumPy 1.x).
For more details, see https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword.
Making the suggested change results in the image below and these changes to behavior:
Removing the other 2 occurrences of copy=False
exhibits no further change.
One more edit: Using Luxonis' own "Oak as webcam" program demo exposed a similar problem within pyvirtualcam
. Downgrading NumPy to 1.26 fixed the problem there. However, I did this from within a separate virtualenv containing depthai installed from Pip. This version of depthai-viewer does not contain the copy=False
lines from above, and yet exhibits the exact same pink windows as above. Downgrading NumPy had no effect on this bug.
So to summarize, steps to reproduce are:
pipenv shell
pipenv install numpy==1.26 depthai depthai-viewer
depthai-viewer
Hey guys,
I will fix the issue on the viewer right now. It's caused by the release of Numpy 2.0.0 which breaks the ABI, this causes undefined behaviour on depthai, like you have experianced... You can fix other examples by installing a version of numpy < 2.0.0
, like @wrzwicky already posted above.
@wrzwicky The reason why installing a lower version of numpy did not solve the issue on the viewer is because the viewer creates it's own venv.
Ubuntu 22.04 x86