Generate the build dependencies for ONNX
Generate the ONNX protobuf source files
The Arm NN ONNX parser requires the ONNX protobuf source files. Generate these source files based on the ONNX message formats defined in the onnx.proto
library.
Use the following commands generate the onnx.pb.cc
and onnx.pb.h
source files in the $BASEDIR/onnx
directory ready for the Arm NN build:
$ cd $BASEDIR $ export ONNX_ML=1 #To clone ONNX with its ML extension $ git clone --recursive https://github.com/onnx/onnx.git $ unset ONNX_ML $ cd onnx $ git checkout 553df22c67bee5f0fe6599cff60f1afc6748c635 $ export LD_LIBRARY_PATH=$BASEDIR/protobuf-host/lib:$LD_LIBRARY_PATH $ $BASEDIR/protobuf-host/bin/protoc onnx/onnx.proto --proto_path=. --proto_path=$BASEDIR/protobuf-host/include --cpp_out $BASEDIR/onnx
For more information and instructions, see the ONNX GitHub.