menglin0320 / resnet_try

Simply try to run resnet on our local environment
MIT License
0 stars 1 forks source link

What is kind of dataset used in your testing? #1

Open mjohn123 opened 7 years ago

mjohn123 commented 7 years ago

Hello, it is very good one to start with ResNet. I also want to test it in the Cifar10 dataset. In the ./prototxt/ResNet-50-deploy.prototxt file, you used

source: "/home/alisc/group/MengLin/training_images.txt"

I did not known which is dataset used in your path. Is it possible to change it for testing with the Cifar10 dataset. I download it to my computer as

batches.meta.txt  data_batch_3.bin  get_cifar10.sh
data_batch_1.bin  data_batch_4.bin  readme.html
data_batch_2.bin  data_batch_5.bin  test_batch.bin

How could I modify these following lines for using the Cifar10 dataset? Thank you in advance

layer {
  name: "data"
  type: "ImageData"
  top: "data"
  top: "label"
  include {
    phase: TRAIN
  }
  transform_param {
    mirror: true
    crop_size: 224
    mean_value: 104
    mean_value: 117
    mean_value: 123
  }
  image_data_param {
    source: "/home/toanhoi/resnet_try-master/CamVid/train.txt"
    new_height: 256 
    new_width: 256
    shuffle: true
    batch_size: 16
  }
}
layer {
  name: "data"
  type: "ImageData"
  top: "data"
  top: "label"
  include {
    phase: TEST
  }
  transform_param {
    mirror: false
    crop_size: 224
    mean_value: 104
    mean_value: 117
    mean_value: 123
  }
  image_data_param {
    source: "/home/toanhoi/resnet_try-master/CamVid/val.txt"
    new_height: 256 
    new_width: 256
    shuffle: true
    batch_size: 16
  }
}
menglin0320 commented 7 years ago

This code is only for my personal usage so it is not neat. You can google how data layer in caffe works. I guess you need to make a folder in the format like

[path to a.jpg] [lable for a] [path to b.jpg] [lable for b]

This set up is not fast. Try to use hdf5, caffe has datalayer specific for hdf5 format files. we tried the net on imagenet and our computer don't have enough space for an hdf5 files that contains all images. Since cifar is very light, just write a script to produce a hdf5 file in the right format. Also, they only provided the deploy prototxt because they have additional code to preprocess the data. I guess they have pycaffe code that is not posted for preprocessing. But cifar10 is simple, I feel you can ignore that step.