YOLOE format conversion

Hi,

I*m following Jaryd’s formidable guide on https://core-electronics.com.au/guides/custom-object-detection-models-without-training-yoloe-and-raspberry-pi/ Everything works like clock until the format conversion. Once I run 'Prompt-Free ONNX Conversion.py, I get this error message, no matter which format I try to use:

Traceback (most recent call last):
File “/home/jert/YOLOE/demo_code/YOLOE Run Model.py”, line 2, in
from picamera2 import Picamera2
File “/usr/lib/python3/dist-packages/picamera2/init.py”, line 11, in
from .picamera2 import Picamera2, Preview
File “/usr/lib/python3/dist-packages/picamera2/picamera2.py”, line 30, in
from picamera2.encoders import Encoder, H264Encoder, MJPEGEncoder, Quality
File “/usr/lib/python3/dist-packages/picamera2/encoders/init.py”, line 7, in
from .encoder import Encoder, Quality
File “/usr/lib/python3/dist-packages/picamera2/encoders/encoder.py”, line 13, in
from ..request import _MappedBuffer
File “/usr/lib/python3/dist-packages/picamera2/request.py”, line 13, in
import simplejpeg
File “/usr/lib/python3/dist-packages/simplejpeg/init.py”, line 1, in
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

What happens? And, of course, how to cure it?

2 Likes

Hey there, @Jerry207389, and welcome to the forum. Glad to have you here.

That error points to a binary compatibility mismatch between NumPy and simplejpeg, which Picamera2 imports.

Could you please confirm which Raspberry Pi OS version are you running, Bookworm or Trixie? Trixie can introduce dependency differences with these guides, so Bookworm is the safer starting point.

Could you also run this in the same Python environment that gives the error and share the output?

import numpy as np
print(np.__version__)