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

BatchNorm layer is broken if bottom blob has num_axes < 4 #594

Open
kostinalexey opened this issue Mar 22, 2021 · 0 comments
Open

BatchNorm layer is broken if bottom blob has num_axes < 4 #594

kostinalexey opened this issue Mar 22, 2021 · 0 comments

Comments

@kostinalexey
Copy link

This can happen when BatchNorm layer sits on top of FullyConnected layer. In this case input blob will have num_axes == 2.

Here is an example of error message
F0322 15:08:58.231948 19174 blob.hpp:251] Check failed: axis_index < num_axes() (2 vs. 2) axis 2 out of range for 2-D Blob with shape 1 512 (512)

The problem is in LayerSetUp function in both batch_norm_layer.cpp and cudnn_batch_norm_layer.cpp. At the end of the function there are following lines which causing the error:

  int N = bottom[0]->shape(0);
  int C = bottom[0]->shape(1);
  int H = bottom[0]->shape(2);
  int W = bottom[0]->shape(3);
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

1 participant