cannot be found TorchInferenceModel

When I imported the `hailo8_ai_sw_suite_2025-10_docker` to create a container and installed the `model zoo v2.18` inside the container, I found that the version of `dfc` (3.33.0) was too low. I manually installed the `hailo_dataflowompiler-3.33.1-py3-none-linux_x86_64.whl` package. However, upon running the code again, the following error occurred. Indeed, the `TorchInferenceModel` module was not present in the `inference_flow.py` file. Traceback (most recent call last):
File “/local/workspace/hailo_virtualenv/bin/hailomz”, line 33, in
sys.exit(load_entry_point(‘hailo-model-zoo’, ‘console_scripts’, ‘hailomz’)())
File “/code/hailo/hailo_model_zoo/hailo_model_zoo/main.py”, line 122, in main
run(args)
File “/code/hailo/hailo_model_zoo/hailo_model_zoo/main.py”, line 101, in run
from hailo_model_zoo.main_driver import compile, evaluate, optimize, parse, profile
File “/code/hailo/hailo_model_zoo/hailo_model_zoo/main_driver.py”, line 16, in
from hailo_model_zoo.core.main_utils import (
File “/code/hailo/hailo_model_zoo/hailo_model_zoo/core/main_utils.py”, line 18, in
from hailo_model_zoo.core.infer import infer_factory
File “/code/hailo/hailo_model_zoo/hailo_model_zoo/core/infer/infer_factory.py”, line 14, in
discovered_plugins = {name: importlib.import_module(name) for _, name, _ in iter_namespace(hailo_model_zoo.core.infer)}
File “/code/hailo/hailo_model_zoo/hailo_model_zoo/core/infer/infer_factory.py”, line 14, in
discovered_plugins = {name: importlib.import_module(name) for _, name, _ in iter_namespace(hailo_model_zoo.core.infer)}
File “/usr/lib/python3.10/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “/code/hailo/hailo_model_zoo/hailo_model_zoo/core/infer/torch_infer.py”, line 10, in
from hailo_model_optimization.flows.inference_flow import TorchInferenceModel
ImportError: cannot import name ‘TorchInferenceModel’ from ‘hailo_model_optimization.flows.inference_flow’ (/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_model_optimization/flows/inference_flow.py)

Hi @user1111,

I suspect this is a version mismatch between the Dataflow Compiler and the Model Zoo. These components are designed to work together in combined released versions. Please check the compatibility table here: 2025-10 (for Hailo-8/8L) | Hailo and make sure you’re using the DFC and Model Zoo versions that were released together.

Thanks,
Michael.

The default model zoo for importing images is v2.17. Since YOLOv26 requires model zoo v2.18, I manually downloaded the necessary files and installed them using pip install. As for the DFC version, it was originally v3.33.0, so I upgraded it to v3.33.1. However, it turned out that this change was not actually related to the DFC version itself. The issue stemmed from the fact that the model zoo v2.18 included an additional file called torch_infer.py, which was not actually used in the code. Simply deleting this file and then re-installing the dependencies using pip install resolved the issue. You might need to investigate why this extra file appeared.

1 Like

Hi @user1111 ,

Thanks for sharing - we will check the extra file issue.