Random Segmentation faul and bus error

Hei, not sure why but. Im getting random segmentation fauls/bus errors with the following code (random: it doesnt happens always, sometimes it works, sometimes not):

from picamera2 import Picamera2, Preview
from picamera2.devices import Hailo
import cv
import tqdm	

with Hailo(args_model) as hailo:
						for img in imgs:
							img = cv2.imread(img)
							img = cv2.resize(img, (1024, 1024))
							tmp = hailo.run(img)
							print(tmp)

and what is more extrange is that this do not happens so far with:

from picamera2 import Picamera2, Preview
from picamera2.devices import Hailo
import cv
import tqdm

with Hailo(args_model) as hailo:
						for img in tqdm(imgs):
							img = cv2.imread(img)
							img = cv2.resize(img, (1024, 1024))
							tmp = hailo.run(img)
							print(tmp)

Im using the following software

# Kernel
Linux AGS-RPI-0006 6.6.74+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.74-1+rpt1 (2025-01-27) aarch64 GNU/Linux
#  Hailo
Executing on device: 0000:01:00.0
Identifying board
Control Protocol Version: 2
Firmware Version: 4.20.0 (release,app,extended context switch buffer)
Logger Version: 0
Board Name: Hailo-8
Device Architecture: HAILO8L
Serial Number: HLDDLBB243501768
Part Number: HM21LB1C2LAE
Product Name: HAILO-8L AI ACC M.2 B+M KEY MODULE EXT TMP
# Python
Python 3.11.2 (main, Nov 30 2024, 21:22:50) [GCC 12.2.0] on linux 
picamera2==0.3.25

I have check and implement other solutions without sucess:

I would prefer a human answer that a LLM generated answer.

It seems similar to Segmentation fault / std::bad_function_call while idling - General - Hailo Community, where in this case a small time increase between calls avoid the segmentation