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

XavierFilller and MSRAFiller fail to fill a bias blob #6275

Closed
ghostsun89 opened this issue Mar 5, 2018 · 3 comments
Closed

XavierFilller and MSRAFiller fail to fill a bias blob #6275

ghostsun89 opened this issue Mar 5, 2018 · 3 comments
Assignees
Labels

Comments

@ghostsun89
Copy link

ghostsun89 commented Mar 5, 2018

Issue summary

XavierFilller and MSRAFiller doesn't work in current master, the error info as below:

I0305 17:03:08.437372  6693 net.cpp:88] Creating Layer conv1
I0305 17:03:08.437381  6693 net.cpp:410] conv1 <- data
I0305 17:03:08.437389  6693 net.cpp:384] conv1 -> conv1
F0305 17:03:08.437960  6693 blob.hpp:122] Check failed: axis_index < num_axes() (1 vs. 1) axis 1 out of range for 1-D Blob with shape 64 (64)

Steps to reproduce

run a caffe prototxt with Convolution, which para filler use Xavier or MSRA.
I ran a Resnet50 prototxt. Part as follow:

layer {
	bottom: "data"
	top: "conv1"
	name: "conv1"
	type: "Convolution"
	convolution_param {
		num_output: 64
		kernel_size: 7
		pad: 3
		stride: 2
                weight_filler {
                  type: "msra"
                }
                bias_filler {
                  type: "msra"
                }
	}
}
@Noiredd
Copy link
Member

Noiredd commented Mar 5, 2018

I can reproduce this behavior. Looks like the bias_filler causes the issue whenever it's set to "msra" or "xavier". If I checkout the commit b3deb95 (right before merging #6240) the problems disappear.

Turns out prior to #6240 when we used Blob::channels (see line 151) on a 1-D blob, it returned 1. Current implementation uses Blob::shape, which makes the following check, erroring out if we request shape(1) of a 1-D blob. Fix would be to safeguard the call to shape - I will push it tomorrow, unless you want to beat me to it.

On the other hand, maybe we should add a bias filler check too, to make sure we catch this next time.

@Noiredd Noiredd added the bug label Mar 5, 2018
@Noiredd Noiredd self-assigned this Mar 5, 2018
@Noiredd Noiredd changed the title XavierFilller and MSRAFiller doesn't work in current master XavierFilller and MSRAFiller fail to fill a bias blob Mar 5, 2018
@ghostsun89
Copy link
Author

@Noiredd Thanks a lot.

@Noiredd
Copy link
Member

Noiredd commented Mar 6, 2018

To be honest, using Xavier/MSRA for bias initialization does not make much sense: how to define fan_in and fan_out for it? Still, we shouldn't be throwing errors in this case - fix is on its way.

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

No branches or pull requests

2 participants