After a few days of efforts, successfully trained their own data set, and carried out a single picture of the test.
The Val accuracy rate is approximately 0.91 during the training process. It seems that the effect is more ideal, whether it has been over-fitted has not been determined.
In the training process, the most annoying thing is to deal with the file path and file storage location.
First, the Imagenet classification section:
Caffe model has a example folder, I created a folder under the example folder, Fine_tune_my. and store all the data in this folder. Includes: Data,model, run file sh.
(1)
In data, it includes training sets, validation sets, average images, and py files that generate DMB.
Also, include some TXT documents that indicate file information. I think these txt documents are the most troublesome.
(2)
In model, it includes training network structure, testing network structure, training parameters.
The task is to classify: traffic signs and traffic lights.
The next goal is to detect traffic signs and traffic lights. There are a few steps to follow:
(1) Prepare the data:
10,000 PICTURES: 6000 training +4000 Test. You need to turn the callout format into a VOC2007 dataset. This is easier, but it takes time.
(2) Adjust the network structure:
(3) Adjust the training parameters, as well as the network parameters
(4) test, submit results
Second, Faster rcnn object detection part:
1. Prepare the data set:
(1) Generate the Output.txt document, where the contents are formatted as follows: 000002.jpg Dog 44 28 132 121
This step consists of two parts: reading each image, detecting each image containing the object type, and outputting the data.
Write in the program change.py.
(2) using the downloaded VOC2007XML.M, generate the XML file in the voc2007 dataset;
(3) Place the picture, annotation set in faster RCNN the specified folder.
(4) modify faster RCNN network parameters (output layer, anchor), training parameters (batch size), and training
First, modify the network structure parameters for a specific data set, including the following:
Modes below: Faster_rcnn_alt_opt below:
stage1_fast_rcnn_train.pt
stage1_rpn_train.pt
stage2_fast_rcnn_train.pt
stage2_rpn_train.pt
faster_rcnn_test.pt
Second, modify the parameters of the processing data section for a specific data set, including:
Lib/datasets below: pascal_voc.py
Lib/datasets below: imdb.py
At last, the training parameters are modified for the training process:
(Batch_size--lib faster rcnn in the config.py of change, learning rate;--Modify in model; max_iters--in Tools)
Learning Rate:
The solve in py-faster-rcnn/models/pascal_voc/zf/faster_rcnn_alt_opt
Iterations: RPN 1th stage, fast rcnn 1th stage, RPN 2nd stage, Fast RCNN 2nd Stage
Py-faster-rcnn\tools's train_faster_rcnn_alt_opt.py
The corresponding Solver file (4) in py-faster-rcnn/models/pascal_voc/zf/faster_rcnn_alt_opt is also modified, stepsize is smaller than the value modified above.
(5) Perform the test and record the test results
First, delete some of the historical interference data first:
The output folder is deleted (or changed to a different name)
Files in Py-faster-rcnn/data/cache
Deletion of files in Py-faster-rcnn/data/vocdevkit2007/annotations_cache (if any)
To execute the training statement:
On Vgg16:run./tools/train_net.py--gpu 2--solver models/vgg16/solver.prototxt--weights data/imagenet_models/ VGG16.v2.caffemodel--imdb Kaggle_train