caffe提取特征

转载地址:https://blog.csdn.net/feelingjun/article/details/70132815

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,则选择设备编号

例子:caffe文件夹下

./build/tools/extract_features.bin /home/wuqingqing/classification/UCMerced_LandUse80/_iter_10000.caffemodel /home/wuqingqing/classification/UCMerced_LandUse80/features/train_val.prototxt fc7 /home/wuqingqing/classification/UCMerced_LandUse80/features/wodefc7 10 lmdb CPU





猜你喜欢

转载自blog.csdn.net/w_q_q2017/article/details/80001061