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

1D blob handling in MSRA/Xavier fillers + new filler tests #6278

Merged
merged 2 commits into from
Mar 9, 2018

Conversation

Noiredd
Copy link
Member

@Noiredd Noiredd commented Mar 6, 2018

#6240 changed fillers to use Blob::shape instead of legacy accessors. However, the legacy functions returned 1 when the requested dimension didn't exist (e.g. Blob::width on a 1D blob). Unfortunately, some fillers (Xavier, MSRA) relied on this fact when computing fan_out. Since shape will fail a CHECK when a dimension is exceeded, issue #6275 happened (attempt to fill a bias blob with MSRA will cause an error).
This PR adds the necessary checks to the filler code - now a filler will check whether a specified dimension can be requested before calling shape.

We could also consider upgrading tests for fillers - currently they are only ran on 4D blobs. Tests for other dimensions might, IMHO, skip the mathematical correctness checks and just make sure we can fill other things (perhaps with a LOG on Xavier and MSRA that they were designed for 4D blobs).

Fixes #6275

@Noiredd
Copy link
Member Author

Noiredd commented Mar 8, 2018

I refactored the filler tests - now we can run them on different shapes of blobs more easily. The test suite has been expanded to make use of that, so we now check 1D as well as ND blobs. Those new tests would fail on an issue like #6275.

@Noiredd Noiredd changed the title 1D blob handling in MSRA/Xavier fillers 1D blob handling in MSRA/Xavier fillers + new filler tests Mar 8, 2018
@Noiredd Noiredd merged commit 69da2cf into BVLC:master Mar 9, 2018
@Noiredd Noiredd deleted the filler-fix branch March 9, 2018 08:19
beniz pushed a commit to jolibrain/caffe that referenced this pull request May 23, 2018
1D blob handling in MSRA/Xavier fillers + new filler tests
XinYao1994 pushed a commit to XinYao1994/caffe that referenced this pull request Aug 29, 2018
1D blob handling in MSRA/Xavier fillers + new filler tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant