ncnn框架


1、下載和編譯ncnn

git clone https://github.com/Tencent/ncnn
cd ncnn
mkdir build && cd build
cmake ..      #編譯目錄下的CMakeLists.txt
打開根目錄下的CMakeLists.txt文件,定位到最后六行,修改如下:

add_subdirectory(examples)
# add_subdirectory(benchmark)
add_subdirectory(src)
if(NOT ANDROID AND NOT IOS)
#add_subdirectory(tools)
endif()

打開examples的編譯,關掉tools的編譯

make -j4
make install

  

 

2、在ncnnkuangjia/ncnn/examples目錄中拷貝squeezenet_v1.1.bin、squeezenet_v1.1.param和synset_words.txt到ncnnkuangjia/ncnn/build/examples目錄中  下載一張圖片命名1.png

./squeezenet 1.png 

可以看到結果

 

3、在ncnnkuangjia/ncnn/examples 目錄下有squeezenet.cpp代碼

 

 

 

舊版caffe模型轉換成新版caffe模型

/caffe/build/tools/upgrade_net_proto_text    deploy.prototxt    new_deplpy.prototxt
 ~/caffe/build/tools/upgrade_net_proto_binary       bvlc_alexnet.caffemodel        new_bvlc_alexnet.caffemodel

 

新版caffe模型轉ncnn模型

./ncnn/build/tools/caffe/caffe2ncnn   new_deplpy.prototxt   new_bvlc_alexnet.caffemodel      alexnet.param    alexnet.bin

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM