Skip to content

Program generates" ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88" #1

@windy54

Description

@windy54

Hi,
I saw your project in the magpi and thought I would demo it at our forthcoming PI Jam.

The program generates the following errors

(pi_classifier) pi@aicam:~/pi_classifier $ python demo.py Traceback (most recent call last): File "/home/pi/pi_classifier/demo.py", line 9, in <module> from picamera2 import CompletedRequest, MappedArray, Picamera2 File "/usr/lib/python3/dist-packages/picamera2/__init__.py", line 11, in <module> from .picamera2 import Picamera2, Preview File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 30, in <module> from picamera2.encoders import Encoder, H264Encoder, MJPEGEncoder, Quality File "/usr/lib/python3/dist-packages/picamera2/encoders/__init__.py", line 7, in <module> from .encoder import Encoder, Quality File "/usr/lib/python3/dist-packages/picamera2/encoders/encoder.py", line 12, in <module> from ..request import _MappedBuffer File "/usr/lib/python3/dist-packages/picamera2/request.py", line 13, in <module> import simplejpeg File "/usr/lib/python3/dist-packages/simplejpeg/__init__.py", line 1, in <module> from ._jpeg import encode_jpeg, encode_jpeg_yuv_planes File "simplejpeg/_jpeg.pyx", line 1, in init simplejpeg._jpeg ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject (pi_classifier) pi@aicam:~/pi_classifier $
In order to get this far I performed the following steps:

  1. installed imx software as per the article

  2. I had then had to install opencv which I did in a virtual environment as follows
    python -m venv --system-site-packages pi_classifier so that picamera2 was available within the virtual environment

  3. installed opencv using pip install opencv-contrib-python

Not sure what to try to fix it, some suggestions are update numpy and simplejpeg.

How did you set up your environment?

I am using a pi0w2 with the latest release of raspberry pi os, i.e. image created July 26th

great article,

Steve gale

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions