This repository contains a converter for certain machine learning models from onnx to mlpack format. Currently this repository is still under construction and might undergo some major refactoring, please use with cautios.
Models | Graph Generation | Weight Transfer |
---|---|---|
mobileNet | ✔️ | ✔️ |
yolo-tiny v2 | ✔️ | ✔️ |
Iris classification | ✔️ | ✔️ |
-
MLPack Installation:
- Ensure that MLPack is installed on your local system. Follow the official MLPack build instructions to complete this step.
-
ONNX Installation:
- If you don't have Protobuf installed, ONNX will internally download and build Protobuf during its build process. You only need to build ONNX. Refer to the official ONNX build instructions for more details.
- However, to avoid potential version issues in the future, we have provided a zipped format of ONNX in the
build_onnx
repository along with a script that will directly install ONNX on your system.
follow the below instruction to build onnx and make the repository running:
-
Clone the Repository:
- Clone the
onnx-mlpack
repository to your local system and navigate to the repository directory.
- Clone the
-
Build ONNX:
-
Run the following commands to build ONNX:
chmod +x run.sh
./run.sh
-
This will generate all the necessary build files for ONNX inside the
build_onnx
folder.
-
-
Verify mlpack and ONNX Build:
- With both ONNX and mlpack built, it's time to test the setup with an example repository.
-
Go to the
example/iris-classification
folder. -
In the Makefile, update the mlpack header path to match your mlpack build path. For example:
-I/home/your_username/mlpack/build/installdir/include
-
Run the make command and check the console output to verify that everything is working correctly. If everythig goes fine you can similarly run the other example as well.