Burn Import: A Crate for ONNX Model Import into the Burn Framework
burn-import facilitates the seamless import of machine learning models, particularly those in the
ONNX format, into the Burn deep learning framework. It automatically generates Rust source code,
aligns the model structure with Burn's native format, and converts tensor data for Burn
compatibility.
Note: This crate is in active development and currently supports a limited set of ONNX operators.
Working Examples
For practical examples, please refer to:
Usage
Importing ONNX Models
Follow these steps to import an ONNX model into your Burn project:
-
Update
build.rs: Include the following Rust code in yourbuild.rsfile:use ModelGen; -
Modify
mod.rs: Add this code to themod.rsfile located insrc/model: -
Utilize Imported Model: Use the following sample code to incorporate the imported model into your application:
use tensor; use NdArrayBackend; use Model;
Contribution
Interested in contributing to burn-import? Check out our development guide for
more information.