DetectNet --model

Hello everyone.
I’m following the guide Jetson AI Fundamentals - S3E5 - Training Object Detection Models - YouTube to train a neural network from scratch.
When the author (@dusty_nv ) makes the inference, the string “–model = …” is included in the command line.
Looking at the detectnet.py code, there is no parameter in the parser argument called –model = ….
The questions are:

  • Does the –model = … parameter replace the –network = … parameter?
  • Where can I find references to –model = …?

Thank you.

Hi @forflafor, the extended command-line parameters for custom models get parsed in the C++ code here: https://github.com/dusty-nv/jetson-inference/blob/6bf94f753c727ea50f256fdec5fbe74bee540773/c/detectNet.cpp#L339

Although it may not be Pythonic, I did it this way to keep the parsing and bindings the same between C++ and Python to avoid issues or changes in command lines between the C++ and Python versions of the programs.

The --model and --network arguments are actually interchangeable, however --network is normally used for the built-in models that come with the repo and --model is used for the custom models (typically ONNX models).

When loading a custom model with --model, you also need to specify the input/output layer names and the label file (as shown in the tutorial). Whereas using one of the built-in networks with --network, this additional information is already stored in the code here.

Hope that makes sense! :)

Yes, it makes sense. I didn’t understand how to load a custom model directly from python code.
I solved my problem thanks to this topic:

Custom trained model detectNet jetson_inference

However, thanks for your explanations.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.