Training of FCN Network--taking Sift-flow data set as an example

Source: Internet
Author: User

Reference article: http://blog.csdn.net/u013059662/article/details/52770198

Caffe installation configuration, as well as the use of FCN in my front of the article has been mentioned, this side will not be more detailed. In the following section, let's look at how to use data sets provided by others to train your model! After this article, I plan to write about how to fine-tune and make my own datasets, and fine-tune with my own datasets.

(i) Data preparation (take Sift-flow data set for example)

Download the dataset: http://pan.baidu.com/s/1dFxaAtj , and unzip to the /fcn.berkeleyvision.org/data/ next, and rename the folder name to sift-flow . After that, the data is all resize to 500*500.

It must be noted that/fcn.berkeleyvision.org/data/下本来就有一个文件夹叫sift-flow,千万不要覆盖。同时,这些原本就存在的文件夹里的东西还要全部复制到新解压的sift-flow文件夹下边。你可以先把原本的sift-slow重新命名为sitf-flow_1,然后再解压复制!

(ii) Download the pre-training model

Download the pre-trained model of VGG-16 into the /fcn.berkeleyvision.org/ilsvrc-nets/ directory and rename it to vgg16-fcn.caffemodel .

: Http://pan.baidu.com/s/1gfeF4wN

(c) Source code modification1. prototxt File Modification

Go to the folder and replace the and, siftflow-fcn32s test.prototxt trainval.prototxt fc6 respectively, with the fc7 other names, for example: fc6_new and fc7_new .

The reason is that we downloaded the pre-training model VGG-16 The original model contains the FC6 and fc7 of the two fully connected layers, and in prototxt, so that we add a new convolutional layer, when the model is loaded, if the name, and the structure of the data is different, will be error. If renamed, the original FC6/7 will be ignored and our new layer is used.

2. Caffe Path Join

Since the FCN code and the Caffe code are separate folders, the Python interface of Caffe must be added to the path. Here are two scenarios, one of which is to join in before all code appears import caffe :

1 Import SYS 2 sys.path.append ('Caffe root directory/python')

Another way to do this once and for all is to add the interface to the terminal or BASHRC PYTHONPATH :

Export Pythonpath=caffe root directory/python: $PYTHONPATH
(iv) Training
1 $ cd CD siftflow-fcn32s/2 $ python solve.py

Here are a few questions to meet:

(1) No module named Surgery,score

The reason is that there are two files in the download FCN Source solution directory: surgery.py and score.py. These two files are downloaded to bring their own, not Caffe comes with, nor the front I install Caffe need to configure. Since I was executing under this folder in the/FCN root directory/siftflow-fcn32s/, these two files could not be found. So, the solution is:

CP surgery.py score.py./siftflow-fcn32s/

Copy the surgery.py and score.py to the siftflow-fcn32s.


(2) Importerror:no module named Setproctitle

The solution is: Install setproctitle! sudo pip install setproctitle

(3) Indexerror:list index out of range

Solution: Modify the GPU number No. 0 GPU

(4) No MODULW named Siftflow_layers

Solution: Crazy, dry mistake all the. py files underneath the root directory to siftflow-fcn32s inside.

OK, now it's time to start training! Look at the training process:

Because the loss loss is very big, I do not know when can converge, so put first put, wait for run out the result come I come again to update!

Training of FCN Network--taking Sift-flow data set as an example

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.