Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

MXNet conv should check the number of elements in strides, padding, etc. #10689

Closed
zheng-da opened this issue Apr 25, 2018 · 2 comments
Closed

Comments

@zheng-da
Copy link
Contributor

MXNet conv doesn't check the number of elements in strides, padding, etc.

Below is the code from @anirudh2290 that generates the bug.

import mxnet as mx
arr = mx.nd.random.uniform(shape=(10, 10, 32, 32))
weight1 = mx.nd.random.uniform(shape=(10, 10, 3, 3))
arr1 = mx.nd.Convolution(data=arr, weight=weight1, no_bias=True, kernel=(3, 3), stride=(1), num_filter=10)
arr2 = mx.nd.Convolution(data=arr, weight=weight1, no_bias=True, kernel=(3, 3), stride=(1, 1), num_filter=10)
print((arr1 == arr2).asnumpy().sum())

This outputs 2616.0, while we expect 3000 because the output shape is (10L, 10L, 30L, 1L).

@wkcn
Copy link
Member

wkcn commented Apr 26, 2018

It seems that the shape of arr1 is (10,10,30,1), and the shape of arr2 is (10,10,30,30).
The cpu output is 3000 in MXNet 1.2.0 (0ca6dd2).
However, In MXNet 1.1.0 (pip install), the program crashed and return 'Command terminated
'.

@zheng-da
Copy link
Contributor Author

zheng-da commented Jul 2, 2018

we now check the strides and paddings: #10666

@zheng-da zheng-da closed this as completed Jul 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants