background : The mobile terminal needs to call the calculation of the deep learning model .
programme :python Training models –> go to MNN Framework model –> Put in C++ call (SDK)–>Java call SDK(JNI).
CentOS Linux release 7.9.2009 (Core)
Linux iZuf627r0ggzf84xn57fuvZ 3.10.0-1160.62.1.el7.x86_64
Tesla V100 32G CUDA11
Miniconda3
recommend Linux System , Not recommended Windows System .
install :
sudo yum install cmake3 protobuf -y
Be careful : CMake 3.0 or higher is required, therefore :
sudo ln -s /usr/bin/cmake3 /usr/bin/cmake
View documents directly :https://github.com/alibaba/MNN/blob/master/README_CN.md
Tools
MNN-Converter: Model transformation tools , from Frontends and Graph Optimize constitute . The former is responsible for supporting different training frameworks ,MNN The current support Tensorflow(Lite)、Caffe、ONNX(PyTorch/MXNet The model of can be changed into ONNX The model goes to MNN) and Torchscripts; The latter is fused by operators 、 Operator substitution 、 Layout adjustment and other ways to optimize the map , Generally, it runs offline .
MNN-Compress: Model compression tools , Under the permission of certain accuracy error , Yes MNN The model is compressed , Reduce model volume , Improve operational performance .
MNN-Express : Support model operation with control flow , Support calling MNN Operator for custom calculation .
MNN-CV : similar OpenCV , But the core computing function is based on MNN Image processing algorithm library implemented
MNN-Train :MNN Training module , Support training on all platforms
Reference resources :https://www.yuque.com/mnn/cn/demo_project
download MNN engineering :
git clone https://github.com/alibaba/MNN.git
Choices before compilation :vim CMakeLists.txt
I think CMakeLists.txt All of them are very useful , I do it manually ON Yes , It may be used in the future learning process :
compile :
cd path/to/MNN
# Generate schema , Optional
cd schema && ./generate.sh
# Compile
cd path/to/MNN # Notice going back to the root directory
mkdir build && cd build
cmake -DMNN_BUILD_DEMO=ON ..
make -j
Build this in the system MNN after , Can use MNN Many tools provided .
Code and introduction :https://github.com/xddun/MNN_Demos
https://blog.csdn.net/wl1710582732/article/details/107731147