caffe提取已训练好模型的特征

按照caffe官网教程:

1、创建一个临时文件夹
$ mkdir examples/_temp
2、我们为三张图片添加一个文件列表
$ find `pwd`/examples/images -type f -exec echo {} \; > examples/_temp/temp.txt
3、将使用 imagedatalayer 预计标签之后的每一个文件名,所以让我们添加一个 0 到每一行
的末尾
$ sed "s/$/ 0/" examples/_temp/temp.txt > examples/_temp/file_list.txt
4、从 ILSVRC dataset 中下载均值图像数据库
$ ./data/ilsvrc12/get_ilsvrc_aux.sh
5、使用其中的 data/ilsvrc212/imagenet_mean.binaryproto 去定义网络结构。将定义结构的文件 cope 到我们的临时文件夹。
$ cp examples/feature_extraction/imagenet_val.prototxt examples/_temp
6、进入 imagenet_val.prototxt 更改路径。更改其中$CAFFE的地方
7、提取特征
$ ./build/tools/extract_features.bin models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel examples/_temp/imagenet_val.prototxt fc7 examples/_temp/features 10 lmdb
8、出现错误“Check failed: status.ok() Failed to open leveldb examples/_temp/features”
$ rm -rf examples/_temp/features/
再运行一次基本就可以了。


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值