本文共 2338 字,大约阅读时间需要 7 分钟。
系统环境: Ubuntu 18.04.5
git clone https://github.com/google/protobuf.gitcd protobufgit submodule update --init --recursive./autogen.sh./configure或者 指定 安装目录 (个人用户要指定到 /home/当前用户名/usr/local/ 不然下方可能会报错)./configure --prefix=/home/moli/usr/local/makemake checkmake installldconfig # refresh shared library cache.
git submodule update --init --recursive 执行,可能遇到 benchmark.git 和 googletest.git 下载失败;
我的方法是手动下载这两个 git 库 然后 复制到 protobuf/third_party 进行解压
git submodule update --init --recursive# 报错如下Cloning into 'third_party/benchmark'...error: RPC failed; result=52, HTTP code = 0fatal: The remote end hung up unexpectedlyClone of 'https://github.com/google/benchmark.git' into submodule path 'third_party/benchmark' failed
./autogen.sh 执行遇到报错
./autogen.sh# 报错如下+ mkdir -p third_party/googletest/m4+ autoreconf -f -i -Wall,no-obsolete./autogen.sh: 37: ./autogen.sh: autoreconf: not found
sudo apt-get install cmake-curses-guisudo apt-get install autoconf automake libtool
普通用户 make install 执行遇到报错
root 权限用户应该不会遇到这个问题
libtool: error: error: cannot install 'libprotoc.la' to a directory not ending in /usr/local/lib
./configure --prefix=/home/moli/usr/local/
git clone https://github.com/alibaba/MNN.gitcd MNNcd schema && ./generate.shcd ..mkdir build && cd buildcmake -DMNN_BUILD_DEMO=ON -DMNN_BUILD_CONVERTER=true ..make -j32# 安装完成, 查看 版本./MNNConvert --version0.2.1.5git
Protobuf 如果没有安装可能会遇到如下报错:
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)Call Stack (most recent call first):.. tools/converter/CMakeLists.txt:14 (find_package)-- Configuring incomplete, errors occurred!
sudo apt-get install libprotobuf-dev protobuf-compilerprotoc --version# 输出如下libprotoc 3.0.0
./MNNConvert -f TF --modelFile ../../changeModel/model-mobilenet_v1_075.pb --MNNModel mobilenet.mnn --bizCode biz# 输出如下:MNNConverter Version: 0.2.1.5git - MNN @ 2018Start to Convert Other Model Format To MNN Model...Start to Optimize the MNN Net...Converted Done!
选取一张人像图像 test.png 安放在 MNN/build/test 目录下
执行命令如下:
./multiPose.out mobilenet.mnn test/test.png pose.png
恭喜你已经读到文末啦,多谢你的点赞鼓励!
转载地址:http://qcmxf.baihongyu.com/