[error] Failed to produce compiled graph [error] TypeError: expected str, bytes or os.PathLike object, not NoneType

Hey @Dharmendra_Sharma,

Quick tip first: Since you’re working with a custom ONNX model, I’d recommend using the Dataflow Compiler (DFC) directly rather than the Model Zoo. The Model Zoo works great for our ready-made ONNX models, but the DFC gives you more flexibility when working with custom models that differ from our standard implementations.

About your error:

Your conversion is progressing nicely through parsing and optimization, but it’s hitting a snag during compilation with this message:

[error] Failed to produce compiled graph
[error] TypeError: expected str, bytes or os.PathLike object, not NoneType

This typically points to an environment configuration issue or a missing/incorrect path. Here are some troubleshooting steps that have helped others with similar issues:

1. Set up a Python virtual environment
Running the DFC outside a virtual environment can cause path and dependency conflicts. Try creating a fresh environment:

python -m venv .venv
source .venv/bin/activate
# Reinstall DFC and HailoRT wheels in this environment

Then run your conversion again from within this environment.

2. Verify all your file paths
Double-check that your paths for --ckpt, --calib-path, and --yaml are correct and the files are accessible.

3. Check your calibration images
Make sure your calibration directory (/content/calib) contains valid images in the correct format and size. Empty directories or corrupted files can cause the process to fail.

4. Review your YAML configuration
If you’re using a custom class count, ensure your YAML reflects this (e.g., output_shape: 52x5x100 for 52 classes). Also verify that network_path points to your ONNX file, and leave url empty if you’re not using it.

5. Start fresh
Sometimes leftover files from previous runs can interfere. Try removing any .har or temporary files and running the complete pipeline again from scratch.

Additional context:
This error can also occur if the model parsing step fails silently, which might be due to an unsupported ONNX model structure, missing layers, or incorrect file paths.

Give these a try and let me know if you’re still running into issues!

Related discussions you might find helpful: