我是靠谱客的博主 整齐小蝴蝶,这篇文章主要介绍ONNX转换NCNN,现在分享给大家,希望可以做个参考。

ncnn编译依赖OpenCV和protobuf

一、安装OnenCV

下载 Releases · opencv/opencv · GitHub

以OpenCV 4.5.4为例,下载Source code (zip),

##源码编译
unzip opencv-4.5.4.zip
cd opencv-4.5.4
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j8
sudo make install
sudo ldconfig

二、安装protobuf

下载Releases · protocolbuffers/protobuf · GitHub

以3.19.1为例

unzip protobuf-all-3.19.1.zip
cd protobuf-all-3.19.1
./configure --prefix=/usr/local
make -j4
sudo make install
sudo ldconfig

三、安装NCNN

1、编译NCNN

git clone https://github.com/Tencent/ncnn.git
cd ncnn
mkdir build 
cd build
cmake ..
make
make install

2.ONNX转换NCNN

ncnn编译完后,在build/tools/onnx里会生成个可执行文件onnx2ncnn

./onnx2ncnn mobilenetv2.onnx mobilenetv2.param mobilenetv2.bin

最后

以上就是整齐小蝴蝶最近收集整理的关于ONNX转换NCNN的全部内容,更多相关ONNX转换NCNN内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(140)

评论列表共有 0 条评论

立即
投稿
返回
顶部