pyorbbecsdk icon indicating copy to clipboard operation
pyorbbecsdk copied to clipboard

ValueError: ndarray is not C-contiguous

Open madhuareti opened this issue 8 months ago • 3 comments

I am having issues using a femto bolt camera. I was able to run the depth stream, align color with depth(1024,1024, 15fps) and color image (1280,960,15fps) until yesterday. But I am getting a "failed to convert frame to image" error when I try to use the default color.py example and "ValueError: ndarray is not C-contiguous" error when I run the depth.py example.

On the other hand, the Orbecviewer and the cpp examples in OrbecSDK are working fine with the camera. Please advise on how I can resolve this within the python library

madhuareti avatar May 29 '25 15:05 madhuareti

I tried forcing aligned_depth_frame.get_data().copy(order='C') only to find out that I am getting all 0 values in the data

madhuareti avatar May 29 '25 15:05 madhuareti

Same issue here with Gemini2. I was able to run simple example scripts until yesterday, and suddenly it's giving me an error ("ndarray is not C-contiguous") today. I see this error even after reboot. I don't have an issue running the viewer.

[Update] after downgrading numpy to 1.26.4 (which was done by running pip install -r requirement.txt), the issue is gone. It seems higher version of numpy (2.2) was installed somehow and that caused the error.

[Resolved] I removed the fixed version (2.11.0) for pybind11 as @YeWenxuan64 said below and rebuilt/reinstalled the package, and it works now with numpy>2.0. Thank you!

bhoram avatar Jul 01 '25 14:07 bhoram

请使用numpy版本小于2.0,或者把requirement里面的pybind11版本限制去掉,把pybind11升级到最新再编译pyobsdk english: Please use numpy version less than 2.0, or remove the pybind11 version restriction from the requirements and upgrade pybind11 to the latest version before compiling pyobsdk

YeWenxuan64 avatar Jul 01 '25 19:07 YeWenxuan64