mnn编译

1. git clone https://github.com/alibaba/MNN.git

android端参考:https://www.yuque.com/mnn/en/build_android

linux端配置(本次)

2. 编译步骤

a) 为了能够对模型进行量化,请在make之前,在CMakeLists.txt中打开quantize

b) protobuf安装:
git clone https://github.com/protocolbuffers/protobuf.git
如果没有autoconf命令,请用下面的命令安装(如果有跳过次步骤)
apt-get install autoconf automake libtool
cd protobuf
./autogen.sh
# 指定安装路径
./configure --prefix=/usr/local/protobuf
#编译
make
# 测试,这一步很耗时间
make check
make install
# refresh shared library cache.
ldconfig
# (动态库搜索路径) 程序加载运行期间查找动态链接库时指定除了系统默认路径之外的其他路径
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/protobuf/lib
# (静态库搜索路径) 程序编译期间查找动态链接库时指定查找共享库的路径
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/protobuf/lib
export PATH=$PATH:/usr/local/protobuf/bin
c) 编译MNN
cd MNN/tools/converter(严格按照步骤操作)
./generate_schema.sh
mkdir build
cd build && cmake .. && make -j4

cd MNN

mkdir build

cd build && cmake .. && make -j4

 

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值