做模型量化用到ncnn工具,下载编译万ncnn后,发现没有onnx2ncnn工具。
opencv和protobuf必须安装否则在编译ncnn的时候,由于检测不到protobuf和opencv,onnx2ncnn工具不会被编译。
所以就去安装protobuf+opencv还是有错,需要安装cmake接着报错,因为没有安装g++工具。
最后全部卸载从头安装了一遍
参考链接:ncnn之二:Linux环境下ncnn安装+protobuf+opencv_mingo_敏-CSDN博客
1 安装g++
$ sudo apt-get install build-essential
2 安装cmake
# 下载地址: https://cmake.org/
$ tar -xvf cmake-3.16.0-rc1.tar.gz
$ chmod -R 777 cmake-3.16.0-rc1
# 检测gcc和g++是否安装
$ sudo apt-get install build-essential
$ cd cmake-3.16.0-rc1
$ sudo ./bootstrap
$ sudo make
$ sudo make install
没有错
3 安装 protobuf
$ sudo apt-get install autoconf automake libtool curl make g++ unzip
$ git clone https://github.com/google/protobuf.git
$ cd protobuf
$ git submodule update --init --recursive
$ ./autogen.sh
$ ./configure
$ make
$ make check
$ sudo make install
$ sudo ldconfig #refresh shared library cache.
在执行第二步报错!!!
git clone https://github.com/google/protobuf.git
解决方法:把http改成git
git clone git://github.com/google/protobuf.git