caffe's python interface learning (1) Generate configuration files

---Restore content begins---

Read denny's blog and write down what I think is short and useful

If you want to use caffe training data, you must first learn to write a configuration file:

(Even if it is a model trained by others, it needs to be fine-tuned, so this level cannot be crossed)

The code will not be pasted, I only summarize the content of the text part:

1 Write the path of each file/data;

2 Create a data layer and pass image data and label data up;

3 convolutional layer; (the creation layer is mainly input parameters, or else it reflects the benefits of the framework, haha)

4 Create an activation function;

5 Create a pooling layer;

6 Create a full link layer; (combine the experience learned by each unit, reduce the dimension and find the feature sum)

7 Create a dropout layer; (prevent overfitting, force a neuron to work together with other randomly selected neurons, weaken the joint adaptability between neuron nodes, and enhance the generalization ability)

8 Create a softmax layer; (calculate the gap with the labeled sample)

9 The accuracy layer is not required during training, but the verification phase is required; (comparison of prediction results with input labels)

10 Write the above settings to the configuration file prototxt file;

 

Through the execution of the above file, we will get two configuration files: train.prototxt and val.prototxt, which are used in the training phase and the verification phase respectively.

 

To generate a configuration file in this way, there must be a premise that the original image must be converted into an LMDB file first. If we have made the original image into a list (txt file, one image per line), we can use ImageData as the input data instead of the LMDB format, that is, the first layer changes from the original Data type to It has become an ImageData type, no LMDB file and mean file, but a txt file.

 

---End of recovery content---

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325187808&siteId=291194637