[Caffe] data production and training

Source: Internet
Author: User

When using Caffe, we want to use our own data for training, and here's how to make your own data. All data production is based on imagenet.

1. Data preparation, we need a train and valid folder, a train.txt and Val.txt (the location of the picture folder can be arbitrary, but the location of the two TXT files in the data/mydata/directory)

The train and valid folders naturally store the images to be trained, and the data formats for Train.txt and Val.txt are as follows

train_example/1. jpg0Train_example/2. jpg0Train_example/3. jpg0Train_example/4. jpg0Train_example/5. jpg0Train_example/6. jpg0Train_example/7. jpg0Train_example/8. jpg0Train_example/9. jpg0

The front is the picture path, then the label, note that the label is starting from 0.

2. In the example directory, create your own folder MyTask, bake all the files in the imagenet and modify them.

create_imagenet.sh

// Current Path example=/home/kongtao/caffe-master/examples/voc2007_test1// store train.txt and Val.txt path, is the data /mydatadata=/home/kongtao/caffe-master/data/voc2007_data1// unchanging tools=/home/ kongtao/caffe-master/build/Tools// home directory for train and Val picture folders (This is the picture directory in the TXT file) train_data_root=/home/kongtao/learn/cnn_learn/voc2007_research/vocdevkit/val_data_root=/home/ kongtao/learn/cnn_learn/voc2007_research/vocdevkit/

Run create_imagenet.sh to generate two data files Lmdb

Make_image_mean.sh also modifies the corresponding path

Finally need to modify the model in the Prototxt file, only need to modify the path

Run

./build/tools/caffe Train--solver=models/bvlc_reference_caffenet/solver.prototxt

That's all you can do.

The above completed a data file creation and training process, for us, in fact, the network architecture is more important, so it is not only the tuning, but also the adjustment of network architecture and improvement, this is the most difficult part.

[Caffe] data production and training

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.