Ubuntu16.04搭建ncnn

2018-12-20  本文已影响0人  我心若氺

最近被安排研究ncnn的效果,ncnn不能支持gpu加速。

先说一下具体环境,使用的是Ubuntu16.04

$ cd <ncnn-root-dir>
$ mkdir -p build
$ cd build
$ cmake ..
$ make -j4

uncomment add_subdirectory(examples)
in CMakeLists.txt with your favourite editor

$ mkdir -p build
$ cd build
$ cmake ..
$ make -j4

copy examples/squeezenet_v1.1.param to build/examples
copy examples/squeezenet_v1.1.bin to build/examples

cd build/examples ./squeezenet yourimage.jpg

output top-3 class-id and score
you may refer examples/synset_words.txt to find the class name
404 = 0.990290
908 = 0.004464
405 = 0.003941

PS:

我开始编译ncnn失败,发现需要加C++11,
在CMakeLists.txt里,加入了这句
set(CMAKE_CXX_FLAGS "-std=c++11")

上一篇 下一篇

猜你喜欢

热点阅读