1.配置NCNN库必要依赖
sudo apt install build-essential git cmake libprotobuf-dev protobuf-compiler libvulkan-dev vulkan-utils libopencv-dev
2.编译NCNN
执行下列命令
git clone https://github.com/Tencent/ncnn.git
cd ncnn
git submodule update --init
mkdir build
cd build
cmake ..
make -j8
make install
编译完成进入 下列文件夹 ncnn/build/install/bin 在这里可以实现转换模型 onnx2ncnn
例如我的如下
./onnx2ncnn是命令,后面跟模型的位置
./onnx2ncnn /media/xcy/dcd05f09-46df-4879-bfeb-3bab03a6cc3a/YOLOv5-Lite/weights/yolov5-lite-sim.onnx /media/xcy/dcd05f09-46df-4879-bfeb-3bab03a6cc3a/YOLOv5-Lite/weights/yolov5-lite.param /media/xcy/dcd05f09-46df-4879-bfeb-3bab03a6cc3a/YOLOv5-Lite/weights/yolov5-lite.bin