Exporting
Exporting
Overview
Export Format
- ONNX: Open Neural Network Exchange format used as the main interchange and downstream conversion format.
exporter section in the config file:Yaml
1exporter:
2 onnx:
3 opset_version: 11exporter.hubai and exporter.blobconverter are used by convert or ConvertOnTrainEnd, not by export alone.CLI
Command Line
1luxonis_train export --config configs/example_export.yaml --weights path/to/weights.ckptPython API
Python
1from luxonis_train import LuxonisModel
2
3model = LuxonisModel("configs/example_export.yaml")
4model.export(weights="path/to/weights.ckpt")Exporting the model can happen automatically at the end of the training by using the
ExportOnTrainEnd callback.NN Archive
CLI
Command Line
1luxonis_train archive \
2 --config configs/detection_light_model.yaml \
3 --weights path/to/checkpoint.ckptPython API
Python
1from luxonis_train import LuxonisModel
2
3model = LuxonisModel("configs/detection_light_model.yaml")
4model.archive(weights="path/to/checkpoint.ckpt")The archive can be created automatically at the end of the training by using the
ArchiveOnTrainEnd callback.Convert
convert is the unified deployment flow in LuxonisTrain. It performs:- export from checkpoint to ONNX
- archive from ONNX to NN Archive
- optional platform-specific conversion for RVC2, RVC3, or RVC4
exporter.hubai or exporter.blobconverter.CLI
Command Line
1luxonis_train convert --config configs/detection_light_model.yaml --weights path/to/checkpoint.ckptPython API
Python
1from luxonis_train import LuxonisModel
2
3model = LuxonisModel("configs/detection_light_model.yaml")
4archive_path, conversion_artifacts = model.convert(
5 weights="path/to/checkpoint.ckpt",
6)convert() returns the ONNX-based NN Archive path together with a dictionary of any additional conversion artifacts, such as a platform-specific archive or legacy blob output.The full conversion flow can be run automatically at the end of training by using the
ConvertOnTrainEnd callback.