You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/12/11 06:04:56 UTC
[GitHub] [incubator-mxnet] sxjscience opened a new issue #19659: [Bug] Latest MXNet fails the GluonNLP test case
sxjscience opened a new issue #19659:
URL: https://github.com/apache/incubator-mxnet/issues/19659
## Description
Minimal reproducible example:
@waytrue17 I think it might be related to the recent bugfix: https://github.com/apache/incubator-mxnet/pull/19614
```python
import mxnet as mx
from mxnet import nd, np, npx
from mxnet.test_utils import assert_allclose
from mxnet.gluon import HybridBlock, Constant
from mxnet.gluon.data import DataLoader
import itertools
mx.npx.set_np()
class Foo(HybridBlock):
def forward(self, data, indices):
mask = indices < 3
data = npx.reshape(data, (-1, -2), reverse=True)
mask = np.reshape(mask, (-1,))
sel = nd.np._internal.boolean_mask(data, mask)
return sel
data = mx.np.random.normal(0, 1, (5, 5, 5, 5, 16))
indices = mx.np.random.randint(0, 5, (5, 5, 5, 5))
data.attach_grad()
indices.attach_grad()
foo = Foo()
foo.hybridize()
with mx.autograd.record():
out = foo(data, indices)
out.backward()
out.wait_to_read()
```
Output:
```
[06:01:25] ../src/storage/storage.cc:199: Using Pooled (Naive) StorageManager for CPU
[06:01:26] ../src/base.cc:80: cuDNN lib mismatch: linked-against version 8005 != compiled-against version 8004. Set MXNET_CUDNN_LIB_CHECKING=0 to quiet this warning.
---------------------------------------------------------------------------
MXNetError Traceback (most recent call last)
<ipython-input-2-89d25fd8d10f> in <module>
14 with mx.autograd.record():
15 out = foo(data, indices)
---> 16 out.backward()
17 out.wait_to_read()
~/env/nlp/lib/python3.6/site-packages/mxnet/ndarray/ndarray.py in backward(self, out_grad, retain_graph, train_mode)
2908 ctypes.c_int(train_mode),
2909 ctypes.c_void_p(0),
-> 2910 ctypes.c_void_p(0)))
2911
2912 def tostype(self, stype):
~/env/nlp/lib/python3.6/site-packages/mxnet/base.py in check_call(ret)
244 """
245 if ret != 0:
--> 246 raise get_last_ffi_error()
247
248
MXNetError: Traceback (most recent call last):
File "../src/imperative/cached_op.cc", line 1150
MXNetError: Check failed: s.op->num_backward_inputs() > bwd_in_dep + bwd_out_dep:
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org