caffe-特征提取

caffe提供的使用工具build/tools/extract_features.bin实现了特征提取功能,该程序需要一个训练好的网络和一个数据输入层,运行后可得到相应数据通过网络某个中间层产生的特征图并保存到磁盘。

用法如下:

$ extract_features \   //可执行的程序

pretrained_net_param \ //预训练网络.caffemodel

feature_extraction_proto_file \ //网络描述文件  .prototxt

extract_feature_blob_name1 [, name2, ...] \   //需要提取的blob名

save_feature_dataset_name1 [, name2, ...] \  //保存特征名

num_mini_batches \ //做特征提取的数据批量数目

db_type \ //输入的数据的格式,lmdb或者leveldb

CPU/GPU \ //选择一何种模式运行,CPU模式或者GPU模式

device_id=0  //如果使用GPU,则选择设备编号


例子:

$ ./build/tools/extract_features.bin \

models /bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel \

models /bvlc_referencv_caffenet/train_val.prototxt \

fc6, fc7, fc8 \

wodefc6, wodefc7,wodefc8 \

20 \

lmdb \

CPU \

猜你喜欢

转载自blog.csdn.net/feelingjun/article/details/70132815
今日推荐