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

../../build/tools/extract_features.bin cifar10_quick_iter_16000 cifar100_quick_train.prototxt ip1 yjyfeature 500 CPU 0

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

void read_image(std::ifstream* file, int* label, char* buffer) {
  char label_char,label_char1;
  file->read(&label_char1, 1);//20的标签
  file->read(&label_char, 1);//100 的标签
  *label = label_char;
  file->read(buffer, kCIFARImageNBytes);
  std::ofstream out("try.txt",std::ios::app);
  int aa=*label;
  out<
  return;
}

const int kCIFARBatchSize = 50000;
const int kCIFARTrainBatches = 1;

85行中
for (int itemid = 0; itemid < 10000; ++itemid) {

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

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


你可能感兴趣的:(程序实践,Deep,Learing)