Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Most of the test results are all black image. #69

Closed
ys404314023 opened this issue Sep 29, 2016 · 7 comments
Closed

Most of the test results are all black image. #69

ys404314023 opened this issue Sep 29, 2016 · 7 comments

Comments

@ys404314023
Copy link

hi .
i train my data on gpu Iteration over 100 thousand times.
But the result is very bad.
Even a very result is just a full black image.

i can't solve this problem,i need you help , thank you!

@bittnt
Copy link
Collaborator

bittnt commented Oct 6, 2016

This problem often happens because the upsampling layer is not initialised with correct weights.

@sadeepj sadeepj closed this as completed Aug 10, 2017
@Sam813
Copy link

Sam813 commented Jun 6, 2018

@bittnt may I know how should I initialize the weights? I have two class of foreground and background (organ segmentation)
I have tried below for initialization of deconvolution layer:
layer {
name: "score2-new"
type: "Deconvolution"
bottom: "score"
top: "score2-new"
param {
lr_mult: 1
}
convolution_param {
num_output: 2 #21
kernel_size: 4
stride: 2
weight_filler: { type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0.2}

also once tried initialization with xavier method but in both case still all my predictions are in black.

@bittnt
Copy link
Collaborator

bittnt commented Jun 6, 2018

I think you used the wrong weight_filler. layer { name: "upsample" type: "Deconvolution" bottom: "score-final" top: "bigscore" param { lr_mult: 0 } convolution_param { num_output: 21 bias_term: false kernel_size: 16 stride: 8 weight_filler: { type: "bilinear" } } }

@Sam813
Copy link

Sam813 commented Jun 7, 2018

@bittnt thank you for fast response,
I will try it and update everyone here,
shall I do the same initialization for all deconvolution layers or just for upsample layer?

@bittnt
Copy link
Collaborator

bittnt commented Jun 7, 2018

Yes. Please give it a try, also read the caffe documentation: http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1BilinearFiller.html

@Sam813
Copy link

Sam813 commented Jun 15, 2018

@bittnt I have tried to train the network with bilinear initialization of deconv layers but yet the output
is black.
can you please take a quick look at the train prototxt to see if the setup s correct?
new_prototxt.txt

@bittnt
Copy link
Collaborator

bittnt commented Jun 15, 2018

I think you made several mistakes in that prototxt, e.g. you set the initialization for the convolution using bilinear.... This is wrong. You can take msra or something to initialize the convolution. please make sure you follow the examples, and you really read the caffe documentations about CNN layers. https://github.com/torrvision/caffe/blob/crfrnn/examples/crfasrnn_segmentation/TVG_CRFRNN_new_traintest.prototxt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants