代码下载
git clone https://github.com/alibaba/MNN.git
代码编译
步骤如下:
- 安装cmake(建议使用3.10或以上版本)、protobuf(使用3.0或以上版本)、gcc(使用4.9或以上版本)
cd /path/to/MNN
./schema/generate.sh
./tools/script/get_model.sh
(可选,模型仅demo工程需要)mkdir build && cd build && cmake .. && make -j4
protobuf编译
https://github.com/protocolbuffers/protobuf/releases/tag/v3.6.0
./autogen.sh
./configure --prefix=/usr/local/protobuf
make -j 40
sudo make install
export PATH=/usr/local/protobuf/bin:$PATH
编译修改
- 修改CMakeLists.txt使能端上训练和调试等开关.
- /usr/share/cmake-3.5/Modules/FindProtobuf.cmake