安装
macos
- veclib
vi CMakeCache.txt
vecLib_INCLUDE_DIR:PATH=/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers
参数提取
# coding=utf-8
import caffe
deploy='./examples/mnist/lenet.prototxt'
caffe_model='./examples/mnist/lenet_iter_10000.caffemodel' #训练好的caffemodel
net=caffe.Net(deploy,caffe_model,caffe.TEST) #加载model和network
w1=net.params['conv1'][0].data
b1=net.params['conv1'][1].data
w1.tofile('conv1_w.txt',sep=" ",format="%f")
每层的运行时间
./build/tools/caffe time -model=./examples/mnist/lenet_train_test.prototxt -weights=./examples/mnist/lenet_iter_10000.caffemodel # -iterations=10