Generate the ONNX protobuf source files

The ONNX protobuf source files are required for the ArmNN ONNX parser. Generate these source files based on the ONNX message formats defined in the onnx.proto library. Use the instructions in the ONNX GitHub:

$ 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
$ 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

The ONNX protobuf source files onnx.pb.cc and onnx.pb.h are generated in the $BASEDIR/onnx directory ready for the Arm NN build.

Previous Next