VoVAllen opened a new issue #16054: [Bug] Error initialization with gluon when 
using mx.set_np_shape(True)
URL: https://github.com/apache/incubator-mxnet/issues/16054
 
 
   
   
   ## Description
   ```python
   import mxnet as mx
   mx.set_np_shape(True)
   mx.gluon.nn.Conv2D(2, 2) # Throw Error
   ```
   ```
   MXNetError                                Traceback (most recent call last)
   <ipython-input-3-4938e62007a6> in <module>
   ----> 1 mx.gluon.nn.Conv2D(2, 2)
   
   
~/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/site-packages/mxnet/gluon/nn/conv_layers.py
 in __init__(self, channels, kernel_size, strides, padding, dilation, groups, 
layout, activation, use_bias, weight_initializer, bias_initializer, 
in_channels, **kwargs)
       318         super(Conv2D, self).__init__(
       319             channels, kernel_size, strides, padding, dilation, 
groups, layout,
   --> 320             in_channels, activation, use_bias, weight_initializer, 
bias_initializer, **kwargs)
       321 
       322 
   
   
~/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/site-packages/mxnet/gluon/nn/conv_layers.py
 in __init__(self, channels, kernel_size, strides, padding, dilation, groups, 
layout, in_channels, activation, use_bias, weight_initializer, 
bias_initializer, op_name, adj, prefix, params)
       113             dshape[layout.find('N')] = 1
       114             dshape[layout.find('C')] = in_channels
   --> 115             wshapes = _infer_weight_shape(op_name, dshape, 
self._kwargs)
       116             self.weight = self.params.get('weight', shape=wshapes[1],
       117                                           init=weight_initializer,
   
   
~/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/site-packages/mxnet/gluon/nn/conv_layers.py
 in _infer_weight_shape(op_name, data_shape, kwargs)
        36     op = getattr(symbol, op_name)
        37     sym = op(symbol.var('data', shape=data_shape), **kwargs)
   ---> 38     return sym.infer_shape_partial()[0]
        39 
        40 
   
   
~/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/site-packages/mxnet/symbol/symbol.py
 in infer_shape_partial(self, *args, **kwargs)
      1150             The order is same as the order of 
list_auxiliary_states().
      1151         """
   -> 1152         return self._infer_shape_impl(True, *args, **kwargs)
      1153 
      1154     def _infer_shape_impl(self, partial, *args, **kwargs):
   
   
~/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/site-packages/mxnet/symbol/symbol.py
 in _infer_shape_impl(self, partial, *args, **kwargs)
      1208             ctypes.byref(aux_shape_ndim),
      1209             ctypes.byref(aux_shape_data),
   -> 1210             ctypes.byref(complete)))
      1211         if complete.value != 0:
      1212             arg_shapes = 
[tuple(arg_shape_data[i][:arg_shape_ndim[i]])
   
   
~/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/site-packages/mxnet/base.py
 in check_call(ret)
       251     """
       252     if ret != 0:
   --> 253         raise MXNetError(py_str(_LIB.MXGetLastError()))
       254 
       255 
   
   MXNetError: Error in operator conv0_convolution0: [08:27:33] 
src/operator/nn/convolution.cc:203: Check failed: dilated_ksize_y <= 
AddPad(dshape[2], param_.pad[0]) (2 vs. 0) : kernel size exceed input
   Stack trace:
     [bt] (0) 
/home/ubuntu/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x4b03ab)
 [0x7f7faa1a53ab]
     [bt] (1) 
/home/ubuntu/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x8ec27b)
 [0x7f7faa5e127b]
     [bt] (2) 
/home/ubuntu/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x2620172)
 [0x7f7fac315172]
     [bt] (3) 
/home/ubuntu/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x26229f5)
 [0x7f7fac3179f5]
     [bt] (4) 
/home/ubuntu/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/site-packages/mxnet/libmxnet.so(MXSymbolInferShapeEx+0x103e)
 [0x7f7fac27c61e]
     [bt] (5) 
/home/ubuntu/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/site-packages/mxnet/libmxnet.so(MXSymbolInferShapePartialEx+0x82)
 [0x7f7fac27cd12]
     [bt] (6) 
/home/ubuntu/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(ffi_call_unix64+0x4c)
 [0x7f80302d54e6]
     [bt] (7) 
/home/ubuntu/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(ffi_call+0x3f1)
 [0x7f80302d4241]
     [bt] (8) 
/home/ubuntu/.pyenv/versions/3.6.8/envs/test_mxnet/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(_ctypes_callproc+0x2cf)
 [0x7f80302cb8ff]
   ```
   
   ## Environment info (Required)
   
   Latest MXNet 1.5 
   
   Package used (Python/R/Scala/Julia): Python
   

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to