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

来源:互联网 发布:淘宝主持怎么找商家 编辑:程序博客网 时间:2024/05/12 06:09

按照caffe官网教程:

1、创建一个临时文件夹$ mkdir examples/_temp2、我们为三张图片添加一个文件列表$ find `pwd`/examples/images -type f -exec echo {} \; > examples/_temp/temp.txt3、将使用 imagedatalayer 预计标签之后的每一个文件名,所以让我们添加一个 0 到每一行的末尾$ sed "s/$/ 0/" examples/_temp/temp.txt > examples/_temp/file_list.txt4、从 ILSVRC dataset 中下载均值图像数据库$ ./data/ilsvrc12/get_ilsvrc_aux.sh5、使用其中的 data/ilsvrc212/imagenet_mean.binaryproto 去定义网络结构。将定义结构的文件 cope 到我们的临时文件夹。$ cp examples/feature_extraction/imagenet_val.prototxt examples/_temp6、进入 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 lmdb8、出现错误“Check failed: status.ok() Failed to open leveldb examples/_temp/features”$ rm -rf examples/_temp/features/再运行一次基本就可以了。


0 0
原创粉丝点击