Question regarding FCN-AlexNet

512 views
Skip to first unread message

Ark

unread,
May 20, 2016, 5:51:17 AM5/20/16
to Caffe Users
Hello

I was going through the FCN training. Below are couple of questions I have.

1. In the deconvolution layer, lr_mult is kept as 0. Then it won't be trained, right? Why is it so? Isn't it the trained weights better than fixed weights?
2. In alexnet based fcn, deconvolution group is kept as 21. But in VGG-32s, they are not provided. Does anybody know which method will be better? Keeping the split or not?
3. In the paper, GoogleNet accuracy is found to be very less compared to VGG. Is there any explanation for that difference?

Best Regards,
Abid K

Carrie Li

unread,
May 26, 2016, 2:13:10 AM5/26/16
to Caffe Users
Hello, Ark

I am new to caffe and deep learning , I am sorry I can't answer your questions.

Recently, I am reading the same paper (fully convolutional networks for semantic segmentation) and trying to reproduce the  FCN-Alexnet( I gave up FCN-32s finetune from VGG16 because of GPU memory). I referred to the code on the model zoo, and it was updated on the github a few days ago. 

Have you reached the 48.0 mean IU?  I only got ~46.5 mean IU in 80000 iterations. 

I changed the training data to lmdb, reused the solver.prototxt, solve.py, sugery.py, score.py and train_val.prototxt, and downloaded an alexnet.caffemodel from github.

Is there any details should I take care? 

Ark

unread,
May 26, 2016, 3:17:24 AM5/26/16
to Caffe Users
Hello Carrie Li,

I am using the scripts here (exact replica) : https://github.com/shelhamer/fcn.berkeleyvision.org/tree/master/voc-fcn-alexnet

Just now, my training hit 68K iteration and it shows 48.01 mean IU :)

Are you using the same test data they used (which contains 736 images) : https://github.com/shelhamer/fcn.berkeleyvision.org/blob/master/data/pascal/seg11valid.txt ?

You should use the same to replicate the result.

By the way, with the new scripts, we are not loading the lmdb, but the images as such one-by-one using some Python Layer they have given.

If you want to replicate the paper, use the exact scripts in the repo and try.

Best Regards,
Abid K.


Carrie Li

unread,
May 26, 2016, 5:21:57 AM5/26/16
to Caffe Users
Thanks for your relpy.

I also uesd segvalid11 as test data. I'll try as you say.

Could you tell me where did you get the alexnet.caffemodel  ?

Abid K

unread,
May 26, 2016, 5:39:26 AM5/26/16
to Carrie Li, Caffe Users
I downloaded it from the zoo. I downloaded the one for bvlc_reference_caffenet. 

By the way, which gpu are you using? How is the time for training?  Which caffe version?

I am working with caffe master with cuDNN v5 on titan X. It takes 195 ms for 100 iteration. 
--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/13869688-0962-4463-9774-145ed0ae96d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carrie Li

unread,
May 26, 2016, 7:29:38 AM5/26/16
to Caffe Users, huiyun...@gmail.com
Thanks again!

I also finetuned from bvlc_reference_caffenet. I need to rename the layer fc6 and fc7 layers to avoid weight inheritence, is it right?

I glanced over the python script which fulfills the data layer, it shuffles the input order of images, but I did not do it when I changed the images to lmdb format. Dose this have effect on the result?

I am working with caffe master on GTX 780 3G, without cuDNN. It takes over 2 days for 80k iterations......Sad......

How many times can be accelerated by using cnDNN?



On Thursday, May 26, 2016 at 5:39:26 PM UTC+8, Ark wrote:
I downloaded it from the zoo. I downloaded the one for bvlc_reference_caffenet. 

By the way, which gpu are you using? How is the time for training?  Which caffe version?

I am working with caffe master with cuDNN v5 on titan X. It takes 195 ms for 100 iteration. 

On Thursday 26 May 2016, Carrie Li <huiyun...@gmail.com> wrote:
Thanks for your relpy.

I also uesd segvalid11 as test data. I'll try as you say.

Could you tell me where did you get the alexnet.caffemodel  ?

On Thursday, May 26, 2016 at 3:17:24 PM UTC+8, Ark wrote:
Hello Carrie Li,

I am using the scripts here (exact replica) : https://github.com/shelhamer/fcn.berkeleyvision.org/tree/master/voc-fcn-alexnet

Just now, my training hit 68K iteration and it shows 48.01 mean IU :)

Are you using the same test data they used (which contains 736 images) : https://github.com/shelhamer/fcn.berkeleyvision.org/blob/master/data/pascal/seg11valid.txt ?

You should use the same to replicate the result.

By the way, with the new scripts, we are not loading the lmdb, but the images as such one-by-one using some Python Layer they have given.

If you want to replicate the paper, use the exact scripts in the repo and try.

Best Regards,
Abid K.


--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users+unsubscribe@googlegroups.com.

Carrie Li

unread,
May 30, 2016, 10:39:17 AM5/30/16
to Caffe Users, huiyun...@gmail.com
Hello, Ark.

I need your help. I used the exact scripts to train models. But the weights of score-fr layer remains all of zeros till 32kth iteration. It learned nothing.

Do you have any idea of the situation? what details should I take care of?

Thank you in advance.

在 2016年5月26日星期四 UTC+8下午5:39:26,Ark写道:
I downloaded it from the zoo. I downloaded the one for bvlc_reference_caffenet. 

By the way, which gpu are you using? How is the time for training?  Which caffe version?

I am working with caffe master with cuDNN v5 on titan X. It takes 195 ms for 100 iteration. 

On Thursday 26 May 2016, Carrie Li <huiyun...@gmail.com> wrote:
Thanks for your relpy.

I also uesd segvalid11 as test data. I'll try as you say.

Could you tell me where did you get the alexnet.caffemodel  ?

On Thursday, May 26, 2016 at 3:17:24 PM UTC+8, Ark wrote:
Hello Carrie Li,

I am using the scripts here (exact replica) : https://github.com/shelhamer/fcn.berkeleyvision.org/tree/master/voc-fcn-alexnet

Just now, my training hit 68K iteration and it shows 48.01 mean IU :)

Are you using the same test data they used (which contains 736 images) : https://github.com/shelhamer/fcn.berkeleyvision.org/blob/master/data/pascal/seg11valid.txt ?

You should use the same to replicate the result.

By the way, with the new scripts, we are not loading the lmdb, but the images as such one-by-one using some Python Layer they have given.

If you want to replicate the paper, use the exact scripts in the repo and try.

Best Regards,
Abid K.


--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users+unsubscribe@googlegroups.com.

Abid K

unread,
May 30, 2016, 11:43:50 AM5/30/16
to Carrie Li, Caffe Users
Did you initialize deconvolution layers with bilinear filters? Also check other layers if they are zero or not. 
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/13869688-0962-4463-9774-145ed0ae96d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/0bd69658-7472-49a7-b25d-8507ba61e891%40googlegroups.com.

Carrie Li

unread,
May 30, 2016, 11:34:32 PM5/30/16
to Caffe Users, huiyun...@gmail.com
Ark, thank you for your reply.

Yes, I have initialize deconvolution layer with bilinear filters, using given scripts. I also checked the weights of deconv layer, they are not zeros.

Should I initialize the weights of fc6 and fc7 layers? The given train.prototxt and val.prototxt don't have the initialization settings.

layer {
  name: "fc6"
  type: "Convolution"
  bottom: "pool5"
  top: "fc6"
  convolution_param {
    num_output: 4096
    pad: 0
    kernel_size: 6
    group: 1
    stride: 1
  }
}

However, if I add initialization to fc6 and fc7, the weights will not be zeros at 800th iteration. Is this modification appropriate?

layer {
    name: "fc6"
    type: "Convolution"
    bottom: "pool5"
    top: "fc6"
    convolution_param {
        num_output: 4096
        kernel_size: 6
        weight_filler {
            type: "gaussian"
            std: 0.005
        }
        bias_filler {
            type: "constant"
            value: 1
        }
    }
}



在 2016年5月30日星期一 UTC+8下午11:43:50,Ark写道:
To unsubscribe from this group and all its topics, send an email to caffe-users+unsubscribe@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/13869688-0962-4463-9774-145ed0ae96d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users+unsubscribe@googlegroups.com.

Abid K

unread,
May 31, 2016, 12:23:10 AM5/31/16
to Carrie Li, Caffe Users
Yes, you should initialize fc6, fc7 etc. Setting multiple layers to zeros will make the network learn nothing. I am initializing them with weights from fc6, fc7 in the original alexnet.

To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/13869688-0962-4463-9774-145ed0ae96d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/0bd69658-7472-49a7-b25d-8507ba61e891%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.

Carrie Li

unread,
May 31, 2016, 12:42:39 AM5/31/16
to Caffe Users, huiyun...@gmail.com
Ok~~~ Should I set the lr_mult and decay_mult params of conv1-5/fc6/fc7 like the original alexnet?

在 2016年5月31日星期二 UTC+8下午12:23:10,Ark写道:
To unsubscribe from this group and all its topics, send an email to caffe-users+unsubscribe@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/13869688-0962-4463-9774-145ed0ae96d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users+unsubscribe@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/0bd69658-7472-49a7-b25d-8507ba61e891%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Abid K

unread,
May 31, 2016, 2:39:44 AM5/31/16
to Carrie Li, Caffe Users
All those I kept just like what I got from github repo.

But I manually copied the weights from original alexnet fc6, rc7 etc to fcn

To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/0bd69658-7472-49a7-b25d-8507ba61e891%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/523d9df7-a1c3-4f8b-96d7-ecd857afe3e9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.

Carrie Li

unread,
May 31, 2016, 3:47:44 AM5/31/16
to Caffe Users, huiyun...@gmail.com
I suddenly realized that I might misunderstand your "initializing them with weights from fc6, fc7 in the original alexnet".

 Do you mean that you coerce the weights of fc6/fc7 from alexnet.caffemodel to fcn-alexnet, even thought they have different shapes? Not meaning randomly initializing fc6/fc7 with gaussian filter?

There are two functions in surgery.py (https://github.com/shelhamer/fcn.berkeleyvision.org/blob/master/surgery.py) that I didn't use, they are transplant() and expand_score(). Did you use them? 


在 2016年5月31日星期二 UTC+8下午2:39:44,Ark写道:
To unsubscribe from this group and all its topics, send an email to caffe-users+unsubscribe@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/13869688-0962-4463-9774-145ed0ae96d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users+unsubscribe@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/0bd69658-7472-49a7-b25d-8507ba61e891%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/523d9df7-a1c3-4f8b-96d7-ecd857afe3e9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Abid K

unread,
May 31, 2016, 6:34:28 AM5/31/16
to Carrie Li, Caffe Users
 Do you mean that you coerce the weights of fc6/fc7 from alexnet.caffemodel to fcn-alexnet, even thought they have different shapes? Not meaning randomly initializing fc6/fc7 with gaussian filter?

Exactly. They have different shapes, but total number of elements are same. So you can transplant the memory as such. I didn't use those function. I followed the procedure in this link :  http://nbviewer.jupyter.org/github/BVLC/caffe/blob/master/examples/net_surgery.ipynb .

To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/0bd69658-7472-49a7-b25d-8507ba61e891%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/523d9df7-a1c3-4f8b-96d7-ecd857afe3e9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.

Carrie Li

unread,
May 31, 2016, 7:02:02 AM5/31/16
to Caffe Users, huiyun...@gmail.com
I think I get it. Thank you very much for your patience. You are so nice ~~~

在 2016年5月31日星期二 UTC+8下午6:34:28,Ark写道:
To unsubscribe from this group and all its topics, send an email to caffe-users+unsubscribe@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/13869688-0962-4463-9774-145ed0ae96d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users+unsubscribe@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/0bd69658-7472-49a7-b25d-8507ba61e891%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/523d9df7-a1c3-4f8b-96d7-ecd857afe3e9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/XgKIFBUJVPI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages