Can’t pass network group name in Python to get rid of log message [get_network_group_and_network_name] No name was given.

Hello,

in this topic @omria suggested some code to solve issue. However, because it was left without a final answer, I’ve decided to create a new one, to emphasis the fact that this is a serious issue. We simply cannot have millions or billions of messages logged into a file on edge based systems (in any systems to be frank).

I’ve spent a significant amount of time, trying to solve the issue. Here is what I did:

Env:

libhailort.so 4.22.0 (/usr/lib/libhailort.so.4.22.0)
hailo_platform==4.22.0
Python 3.10.6, PCIe
HEF with a single group & network: group=yolov6n, network=yolov6n/yolov6n

Goal: pass the network group/name from Python so the log doesn’t spam:
[HailoRT] [info] [hef.cpp:1994] [get_network_group_and_network_name] No name was given. Addressing all networks of default network_group: yolov6n

What I see in Python:

from hailo_platform import HEF
hef = HEF(“yolov6n_2.hef”)
print(hef.get_network_group_names())        # \[‘yolov6n’\]
print(hef.get_networks_names(“yolov6n”))    # \[‘yolov6n/yolov6n’\]

Minimal failing examples

A) Using the low-level ConfigureParams (this is the type configure() expects)

from hailo_platform import HEF, VDevice
from hailo_platform.pyhailort._pyhailort import ConfigureParams  # low-level

hef = HEF("yolov6n.hef")
vdev = VDevice()

# 1) Key = group name
cfg_map = {"yolov6n": ConfigureParams()}
vdev.configure(hef, cfg_map)
# -> HailoRTNotFoundException:
#    [HailoRT] [error] Failed to find network with network name yolov6n/yolov6n

# 2) Key = "group/network" (just to try)
cfg_map = {"yolov6n/yolov6n": ConfigureParams()}
vdev.configure(hef, cfg_map)
# -> HailoRTInvalidArgumentException:
#    Some network group names in the configuration are not found in the hef file: yolov6n/yolov6n

B) Using the high-level ConfigureParams

from hailo_platform import HEF, VDevice, ConfigureParams  # high-level

hef = HEF("yolov6n.hef")
vdev = VDevice()
cfg_map = {"yolov6n": ConfigureParams()}

vdev.configure(hef, cfg_map)
# -> TypeError: expected Dict[str, hailo_platform.pyhailort._pyhailort.ConfigureParams]
#                got Dict[str, hailo_platform.ConfigureParams]

So Python exposes two classes named ConfigureParams (high-level and low-level), and configure() accepts only the low-level one—but with that one I still can’t provide a group/network name, leading to the errors above and the “No name was given…” log on every inference.

Questions:

  1. In HailoRT 4.22.0, what is the correct, supported way in Python to pass the network group/name to VDevice.configure() so that:
  • it finds yolov6n/yolov6n, and

  • the log message “No name was given…” disappears?

  1. Is the presence of two ConfigureParams (high- vs low-level) and the resulting type mismatch expected, or is this a packaging/API inconsistency?

Hey @Chuck_Rhodes,

I’d recommend taking a look at a couple of resources that should help you out with the inference :

  1. First, check out the inference class here: Hailo-Application-Code-Examples/runtime/hailo-8/python/common/hailo_inference.py at main · hailo-ai/Hailo-Application-Code-Examples · GitHub - this shows you how it’s structured.

  2. Then look at how it’s actually used in this example: Hailo-Application-Code-Examples/runtime/hailo-8/python/object_detection/object_detection.py at main · hailo-ai/Hailo-Application-Code-Examples · GitHub

A couple of important things to keep in mind:

  • Make sure your key matches the network group name (not just the network name - it follows the format group/network)
  • You need to use the low-level ConfigureParams from _pyhailort, not the high-level wrapper
  • If you’re getting an error like expected Dict[str, _pyhailort.ConfigureParams], that usually means you’re accidentally using the high-level version instead

About that log message you’re seeing:

[HailoRT] [info] [hef.cpp:1994] [get_network_group_and_network_name] No name was given...

This pops up when either no name gets passed or the device isn’t configured properly with the right network group. Once you get the mapping sorted out in your configure() call, that message should stop showing up.

Hope this helps!


Hi @omria

Thank you for your response and for the tips you provided. First of all, I appreciate the time you took to write your reply. However, I have to admit that your time could have been spent more effectively. You referred me to the class example and the object detection example, but unfortunately, neither of them helps solve the issue.

Moreover, the object_detection.py example produces exactly the same problem! It seems that even your own code does not address the issue.

I also don’t understand why you sent me those examples, considering I already provided you with simple, reproducible code samples that clearly demonstrate the problem. Furthermore, you suggested passing a group/key pair, but as you can see in my example, I am already doing that.

Frankly, the only thing you should do is take any model from Hailo Model Zoo, run it using my example, and show me how to fix the issue. So please, take some time to do this, because generating multi-megabyte logs on edge devices is simply unacceptable.

Best regards,

Chuck Jr.