Hailo FastDepth Inference Fails: Input buffer size 0 vs expected 150528

Hi everyone,

I’m trying to run a FastDepth model on a Hailo-8 device using Python and hailo_platform, but inference fails with the following error:

[HailoRT] [error] CHECK failed - Input buffer size 0 is different than expected 150528 for input 'fast_depth/input_layer1'
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INVALID_OPERATION(6)
[ERROR] Inference failed: Invalid operation. See hailort.log for more information
Segmentation fault

Setup:

  • Raspberry Pi (aarch64)

  • Hailo firmware: 4.20.0

  • Python 3.11

  • Using .bin files as input (size 150528 bytes each)

  • Model input shape: (224, 224, 3)

  • Code uses a custom HailoInfer wrapper to run run_async

What I tried:

  • Verified .bin file size matches expected input size

  • Converted .bin to np.uint8 and reshaped to (224, 224, 3)

Despite this, the Hailo runtime still says the input buffer size is 0. I suspect the problem might be related to how the numpy array is passed to the Hailo bindings (set_buffer), but I’m not sure how to fix it.

Question:

Has anyone encountered the “Input buffer size 0” error when using Hailo Python API? What is the correct way to pass a .bin file to a Hailo HEF model for inference? I want to get depth map of images and save them.

I used the give code for hailo inference.

These are some gstream and hailo coommand result

apt list | grep hailo

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

golang-github-hailocab-go-hostpool-dev/oldstable,oldstable 0.0~git20160125.0.e80d13c-1.1 all
hailo-all/stable,stable,now 4.20.0 all [installed]
hailo-dkms/stable,stable 4.19.0-1 all
hailo-tappas-core-3.28.2/stable 3.28.2 arm64
hailo-tappas-core/stable,now 3.31.0+1-1 arm64 [installed,automatic]
hailofw/stable,stable,now 4.20.0-1 all [installed,automatic]
hailort/stable,now 4.20.0-1 arm64 [installed,automatic]
python3-hailort/stable,now 4.20.0-1 arm64 [installed,automatic]
rpicam-apps-hailo-postprocess-dbgsym/stable 1.8.1-1~bookworm arm64
rpicam-apps-hailo-postprocess/stable,now 1.8.1-1~bookworm arm64 [installed,automatic]
logiicdev1@raspberrypi:~/Downloads/2Dto3D $ pip list | grep hailo
hailort 4.20.0
logiicdev1@raspberrypi:~/Downloads/2Dto3D $ apt list | grep tappas

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

hailo-tappas-core-3.28.2/stable 3.28.2 arm64
hailo-tappas-core/stable,now 3.31.0+1-1 arm64 [installed,automatic]
logiicdev1@raspberrypi:~/Downloads/2Dto3D $ pip list | grep tappas
logiicdev1@raspberrypi:~/Downloads/2Dto3D $ gst-inspect-1.0 hailonet
Factory Details:
Rank primary (256)
Long-name hailonet element
Klass Hailo/Network
Description Configure and Activate Hailo Network. Supports the “flush” signal which blocks until there are no buffers currently processesd in the element. When deactivating a hailonet during runtime (via set_property of “is-active” to False), make sure that no frames are being pushed into the hailonet, since this operation waits until there are no frames coming in.
Author Hailo Technologies Ltd. (“Hailo”)

Plugin Details:
Name hailo
Description hailo gstreamer plugin
Filename /lib/aarch64-linux-gnu/gstreamer-1.0/libgsthailo.so
Version 1.0
License unknown
Source module hailo
Binary package GStreamer
Origin URL http://gstreamer.net/

GObject
±—GInitiallyUnowned
±—GstObject
±—GstElement
±—GstHailoNet

ogiicdev1@raspberrypi:~/Downloads/2Dto3D $ gst-inspect-1.0 hailofilter
Factory Details:
Rank primary (256)
Long-name hailofilter - postprocessing element
Klass Hailo/Tools
Description Allowes to user access Hailonet’s output using an so file.
Author hailo.ai contact@hailo.ai

Plugin Details:
Name hailotools
Description hailo tools plugin
Filename /lib/aarch64-linux-gnu/gstreamer-1.0/libgsthailotools.so
Version 3.31.0
License unknown
Source module gst-hailo-tools
Binary package gst-hailo-tools
Origin URL https://hailo.ai/

GObject
±—GInitiallyUnowned
±—GstObject
±—GstElement
:

logiicdev1@raspberrypi:~/Downloads/2Dto3D $ gst-inspect-1.0 hailooverlay
Factory Details:
Rank primary (256)
Long-name hailooverlay - overlay element
Klass Hailo/Tools
Description Draws post-processing results for networks inferred by hailonet elements.
Draws classes contained by HailoROI objects attached to incoming frames.
Author hailo.ai contact@hailo.ai

Plugin Details:
Name hailotools
Description hailo tools plugin
Filename /lib/aarch64-linux-gnu/gstreamer-1.0/libgsthailotools.so
Version 3.31.0
License unknown
Source module gst-hailo-tools
Binary package gst-hailo-tools
Origin URL https://hailo.ai/

GObject
±—GInitiallyUnowned

logiicdev1@raspberrypi:~/Downloads/2Dto3D $ gst-inspect-1.0 | grep hailo
hailo: hailodevicestats: hailodevicestats element
hailo: hailonet: hailonet element
hailo: synchailonet: sync hailonet element
hailopython: hailopython: HailoPython Element
hailotools: hailoaggregator: hailoaggregator - Cascading
hailotools: hailocounter: hailocounter - postprocessing element
hailotools: hailocropper: hailocropper
hailotools: hailoexportfile: hailoexportfile - export element
hailotools: hailoexportzmq: hailoexportzmq - export element
hailotools: hailofilter: hailofilter - postprocessing element
hailotools: hailogallery: Hailo gallery element
hailotools: hailograytonv12: hailograytonv12 - postprocessing element
hailotools: hailoimportzmq: hailoimportzmq - import element
hailotools: hailomuxer: Muxer pipeline merging
hailotools: hailonv12togray: hailonv12togray - postprocessing element
hailotools: hailonvalve: HailoNValve element
hailotools: hailooverlay: hailooverlay - overlay element
hailotools: hailoroundrobin: Input Round Robin element
hailotools: hailostreamrouter: Hailo Stream Router
hailotools: hailotileaggregator: hailotileaggregator
hailotools: hailotilecropper: hailotilecropper - Tiling
hailotools: hailotracker: Hailo object tracking element
logiicdev1@raspberrypi:~/Downloads/2Dto3D $

If you need i can provide my code

Thanks in advance for any guidance!

Hey @Priyanwada_Athukoral,

I spotted a couple of things that might be causing your issue:

First issue: It looks like you might be missing the tappas-core Python bindings. If you’re using those in your setup, that could definitely be the culprit.

Second issue: That error message you’re seeing - [HailoRT] [error] CHECK failed - Input buffer size 0 is different than expected 150528 for input 'fast_depth/input_layer1' - is telling us that HailoRT is getting an empty buffer (size 0) when it’s expecting 150528 bytes. Even though your .bin file seems to be the right size, the numpy array isn’t getting properly connected to the Hailo buffer object before you call run_async.

I’d recommend checking out how we handle the Python API in our code examples here: Hailo-Application-Code-Examples/runtime/hailo-8/python at main · hailo-ai/Hailo-Application-Code-Examples · GitHub

That should give you a good reference for the proper buffer handling. If you can share your inference code, I’d be happy to take a closer look and help you debug it further.

Hope this helps!