Error Using Inference on an Image

Hello! I am new user. I need help determining why inference on an image fails. I’m certain I’m missing something simple. I apologize if this question is redundant, but I can’t seem to pin this down.

I have success using “HailoRT User Guide: Section 5.5: Python inference Tutorial - Single Model” & success using the randomly generated data. I cannot determine why, after resizing / altering the image, that the inference cannot handle the difference of data expectations. The change in data is just an image from a cannonical dataset.

Error is located within “infer_pipeline.infer(input_data).”

Hailort.log error lines:
“”"
[2025-01-17 18:15:23.916] [5379] [HailoRT] [error] [inference_pipeline.cpp:274] [verify_memory_view_size] CHECK failed - Memory size of vstream yv82/input_layer1 does not match the frame count! (Expected 3145728000, got 4915200)

[2025-01-17 18:15:23.916] [5379] [HailoRT] [error] [inference_pipeline.cpp:201] [infer] CHECK_SUCCESS failed with status=HAILO_INVALID_ARGUMENT(2)
“”"

Software Development Kit via Manual Installation on a Raspberry Pi 5. Runtime environment is the following:
“”"
Hailortcli -fw-control identity:
Executing on device: 0000:01:00.0
Identifying board
Control Protocol Version: 2
Firmware Version: 4.19.0 (release,app,extended context switch buffer)
Logger Version: 0
Board Name: Hailo-8
Device Architecture: HAILO8L
Serial Number: HLDDLBB243301363
Part Number: HM21LB1C2LAE
Product Name: HAILO-8L AI ACC M.2 B+M KEY MODULE EXT TMP
“”"

Thank you for any help!

Hey @tim.j.n17 ,

Welcome to the Hailo Community!

When you encounter this error with yv82/input_layer1, it typically indicates a mismatch between your input data and what the model expects. Let’s walk through how to resolve this.

First, let’s check your model’s requirements:
hailortcli parse-hef {hef}

This will show you the exact specifications your model needs for inference.

To fix this issue, here’s what you need to do:

  1. Image Preprocessing
from PIL import Image
import numpy as np

# Load and resize your image
image = Image.open("image.jpg").resize((224, 224))  # Adjust size as per your model
input_data = np.array(image).astype("float32")
input_data = input_data / 255.0  # Normalize if required
  1. Batch Dimension
# Add batch dimension if needed
input_data = np.expand_dims(input_data, axis=0)
  1. Data Layout If your model expects NCHW format instead of NHWC:
input_data = np.transpose(input_data, (0, 3, 1, 2))

If you’re still experiencing issues, please share:

  1. The output of hailortcli parse-hef {hef}
  2. Your input data shape and type
  3. Any additional error messages from HailoRT

Hope this helps! Let us know if you need any clarification.

Best Regrads,
Omria