转载自:https://blog.csdn.net/qq_37643960/article/details/97028743
1. 官方的安装命令
Build on Host
Install cmake (version >= 3.10 is recommended), protobuf (version >= 3.0 is required) and gcc (version >= 4.9 is required)
cd /path/to/MNN
./schema/generate.sh
./tools/script/get_model.sh(optional, models are needed only in demo project)
mkdir build && cd build && cmake .. && make -j4
2. 测试
cd build
./benchmark.out ../benchmark/models/ 10 0
MNN benchmark
Forward type: CPU thread=4** precision=2
--------> Benchmarking… loop = 10
[ - ] vgg16.mnn max = 1326.345ms min = 1313.118ms avg = 1320.115ms
[ - ] mobilenet-v1-1.0.mnn max = 131.717ms min = 127.972ms avg = 129.133ms
[ - ] SqueezeNetV1.0.mnn max = 166.629ms min = 159.478ms avg = 161.267ms
[ - ] inception-v3.mnn max = 1087.121ms min = 1037.667ms avg = 1059.391ms
[ - ] resnet-v2-50.mnn max = 692.435ms min = 675.514ms avg = 681.700ms
[ - ] MobileNetV2_224.mnn max = 89.804ms min = 79.252ms avg = 83.558ms
3. vscode断点调试
- 把cmakelists.txt中的MNN_DEBUG 设置为ON
- 设置launch.json
"program": "${workspaceFolder}/build/benchmark.out",
"args": ["benchmark/models/", "10", "0"],