caffe安装之后可以跑的第二个实例是在cifar10数据集上,参见http://caffe.berkeleyvision.org/gathered/examples/cifar10.html
跟mnist的过程很类似:
1./data/cifar10/get_cifar10.sh
2./example/cifar10/create_cifar10.sh 注意这里生成的也是lmdb文件
3./example/cifar10/cifar10_quick_train.sh
这时候会发现存在问题:给的例子有错:
找不到leveldb文件,这是因为 caffe_root/examples/cifar10/cifar10_quick_train_test.prototxt定义网络的时候出错了,定义的source是leveldb文件,与生成的leveldb不一致,解决方法是在create_cifar10中修改生成leveldb文件
但是在改网络定义却不行???
cifar10_quick_train_test.prototxt:name: "CIFAR10_quick"
2 layers { 3 name: "cifar" 4 type: DATA 5 top: "data" 6 top: "label" 7 data_param { 8 source: "examples/cifar10/cifar10_train_leveldb" 9 batch_size: 100 10 } 11 transform_param { 12 mean_file: "examples/cifar10/mean.binaryproto" 13 } 14 include: { phase: TRAIN } 15 } 16 layers { 17 name: "cifar" 18 type: DATA 19 top: "data" 20 top: "label" 21 data_param { 22 source: "examples/cifar10/cifar10_test_leveldb" 23 batch_size: 100 24 } 25 transform_param { 26 mean_file: "examples/cifar10/mean.binaryproto" "cifar10_quick_train_test.prototxt" 194L, 2877C
最终正确的实验结果在,caffe在cifar10上实现了76%的正确率
时间: 2024-10-31 00:34:17