caffe 实践程序2——用细分的方法实现caffe中cifar100的识别

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. ../../build/tools/extract_features.bin cifar10_quick_iter_16000 cifar100_quick_train.prototxt ip1 yjyfeature 500 CPU 0  

1,修改convert_cifar_data的文件的内容,

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. void read_image(std::ifstream* file, int* label, char* buffer) {  
  2.   char label_char,label_char1;  
  3.   file->read(&label_char1, 1);//20的标签  
  4.   <span style="color:#000099;">file->read(&label_char, 1);//100 的标签</span>  
  5.   *label = label_char;  
  6.   file->read(buffer, kCIFARImageNBytes);  
  7.  <span style="color:#000099;"> std::ofstream out("try.txt",std::ios::app);  
  8.   int aa=*label;  
  9.   out<<aa<<"\n";</span>  
  10.   return;  
  11. }  

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. const int kCIFARBatchSize = 50000;  
  2. const int kCIFARTrainBatches = 1;  

85行中
[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. for (int itemid = 0; itemid < 10000; ++itemid) {  

2,修改相应的cifar10_quick_train 和 cifar10_quick_test 文件名将10改为100.将最后的输出标签设为100

3,运行create_cifar100.sh和create_cifar100.sh,将训练所得结果保存,记为细分前的结果。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值