Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import pyzed failed with numpy 2.0.0 compatibility errors #57

Open
2 tasks done
Techlorine opened this issue Jul 29, 2024 · 1 comment
Open
2 tasks done

Import pyzed failed with numpy 2.0.0 compatibility errors #57

Techlorine opened this issue Jul 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Techlorine
Copy link

Preliminary Checks

  • This issue is not a duplicate. Before opening a new issue, please search existing issues.
  • This issue is not a question, feature request, or anything other than a bug report directly related to this project.

Description

I pulled the docker image stereolabs/zed:4.1-runtime-cuda11.8-ubuntu22.04 and failed to ran my python script on my device.
The output was ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject. I couldn't import pyzed.sl in my python interactive console either.

P.S.: The pyzed and my script works well after manually downgrade numpy by pip install numpy<=2.

Steps to Reproduce

  1. sudo docker pull stereolabs/zed:4.1-runtime-cuda11.8-ubuntu22.04
  2. sudo docker run --gpus all -it --privileged -v /path/to/depth_capture:/depth --network=host stereolabs/zed:4.1-runtime-cuda11.8-ubuntu22.04
  3. python3
  4. from pyzed import sl
    ...

Expected Result

root@92293044a15a:/depth/zed# python3
Python 3.10.12 (main, Mar 22 2024, 16:50:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyzed import sl
>>>

Actual Result

root@92293044a15a:/depth/zed# python3
Python 3.10.12 (main, Mar 22 2024, 16:50:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyzed import sl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyzed/sl.pyx", line 1, in init pyzed.sl
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

ZED Camera model

ZED2i

Environment

OS: Ubuntu 22.04.4 LTS x86_64
CPU: 13th Gen Intel i7-13700K (24) @ 5.300GHz 
GPU: NVIDIA GeForce RTX 3090
ZED SDK version: 4.1
Docker Image: stereolabs/zed:4.1-runtime-cuda11.8-ubuntu22.04


### Anything else?

_No response_
@Techlorine Techlorine added the bug Something isn't working label Jul 29, 2024
@ElliotHYLee
Copy link

ElliotHYLee commented Aug 8, 2024

same issue.

The maintainer didn't update that the numpy updated to v2.

To save potential poor souls wasting several hours like myself, I ended up using dockerfile like below

FROM stereolabs/zed:4.1-devel-cuda12.1-ubuntu22.04
#FROM stereolabs/zed:3.7-devel-cuda11.7-ubuntu22.04
#FROM stereolabs/zed:4.0-devel-cuda12.1-ubuntu22.04

COPY  ZED_SDK_Ubuntu22_cuda12.1_v4.1.3.zstd.run /home/ZED_SDK_Ubuntu22_cuda12.1_v4.1.3.zstd.run
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6  -y
#RUN pip3 uninstall numpy -y
RUN rm -rf /usr/local/lib/python3.10/dist-packages/numpy*
RUN pip3 install numpy==1.26.4 opencv-python==4.6.0.66 opencv-contrib-python
#RUN python3 /usr/local/zed/get_python_api.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants