Train with 60000 image using data from challenge3_data

  1. modify training_image.txt & testing_image.txt
  2. generate lmdb
  3. compute image mean
  4. modify data layer in resnet_train_test.prototxt
  5. train

Fine tune

  1. relabel images (1:cat/automobile/truck, 0:otherwise)
  2. generate lmdb
  3. change source file in data layer
  4. rename fc layer to fine_tune_fc
  5. train (using --weights)

 

challenge3

1. modify training_image.txt

(testing_image.txt)

~/challenge3_data/training_data$ cp /home/tony333ts/workspace/transform_and_cut/benq_0817_result/training_image.txt .
~/challenge3_data/training_data$ vim training_image.txt

#we need to change the path of the image using vim
:%s/\/home\/tony333ts\/workspace\/transform_and_cut\//

#and do the same to testing_image.txt

2. generate lmdb

# Usage:
#     convert_imageset [FLAGS] ROOTFOLDER/ LISTFILE DB_NAME

~/challenge3_data/training_data$ ./build/tools/convert_imageset ~/challenge3_data/training_data/ training_image.txt train

~/challenge3_data/training_data$ ./build/tools/convert_imageset ~/challenge3_data/training_data/ testing_image.txt test

3. compute image mean

#Usage:
#    compute_image_mean [FLAGS] INPUT_DB [OUTPUT_FILE]

~/challenge3_data/training_data$ ./../caffe/build/tools/compute_image_mean train/ mean.binaryproto

4. modify data layer in resnet_train_test.prototxt

#change yunchi to your username
layer {
  name: "cifar"
  type: "Data"
  top: "data"
  top: "label"
  include {
    phase: TRAIN
  }
  transform_param {
    mean_file: "/home/yunchi/challenge3_data/training_data/mean.binaryproto"
    mirror: true
    crop_size: 28
  }
  data_param {
    source: "/home/yunchi/challenge3_data/training_data/train"
    batch_size: 100
    backend: LMDB
  }
}
layer {
  name: "cifar"
  type: "Data"
  top: "data"
  top: "label"
  include {
    phase: TEST
  }
  transform_param {
    mean_file: "/home/yunchi/challenge3_data/training_data/mean.binaryproto"
    crop_size: 28
  }
  data_param {
    source: "/home/yunchi/challenge3_data/training_data/test"
    batch_size: 100
    backend: LMDB
  }
}

5. train

~/challenge3_data$ ./caffe/build/tools/caffe train --solver=models/resnet_20/resnet_solver.prototxt
#use --snapshot=your_snapshot_path/your_snapshot.solverstate
Made with Slides.com