程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

[reasoning framework] MNN framework c++, python, Java use example demo

編輯:Python

List of articles

  • background
  • System environment
  • MNN Introduce
  • MNN Environmental Science
  • Python Use MNN
  • Reference article

background

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).

System environment

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

MNN Introduce

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

MNN Environmental Science

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 .

Python Use MNN

Code and introduction :https://github.com/xddun/MNN_Demos

Reference article

https://blog.csdn.net/wl1710582732/article/details/107731147


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved