Open giuseppedib opened 5 years ago
Hey, this is the MXNet Label Bot. Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it. Here are my recommended labels: Bug
@mxnet-label-bot add [Bug]
I can confirm the bug with version 1.5.1
@reminisce I think shape with 0s are generally not supported in the original ndarray interface. We will need to use the new numpy array in MXNet:
import mxnet as mx
mx.npx.set_np()
p = mx.np.zeros(shape=(3,0))
Description
The definition of a mx.ndarray, with one of the dimensions set to zero, produces an error in mxnet v1.5.0, while it was working fine in mxnet v1.4.1 .
Environment info
Steps to reproduce
Error Message:
Traceback (most recent call last): File "", line 1, in
File "/anaconda3/lib/python3.7/site-packages/mxnet/ndarray/utils.py", line 67, in zeros
return _zeros_ndarray(shape, ctx, dtype, kwargs)
File "/anaconda3/lib/python3.7/site-packages/mxnet/ndarray/ndarray.py", line 3885, in zeros
return _internal._zeros(shape=shape, ctx=ctx, dtype=dtype, kwargs)
File "", line 34, in _zeros
File "/anaconda3/lib/python3.7/site-packages/mxnet/_ctypes/ndarray.py", line 92, in _imperative_invoke
ctypes.byref(out_stypes)))
File "/anaconda3/lib/python3.7/site-packages/mxnet/base.py", line 253, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [16:54:11] src/imperative/./imperative_utils.h:145: Operator _zeros inferring shapes failed.
input shapes:
output shapes:
[3,-1]
operator attributes:
dtype : float32
ctx : cpu(0)
shape : (3, 0)
Stack trace: [bt] (0) 1 libmxnet.so 0x00000001133fc929 mxnet::op::NDArrayOpProp::~NDArrayOpProp() + 4473 [bt] (1) 2 libmxnet.so 0x000000011497bb1f mxnet::imperative::SetShapeType(mxnet::Context const&, nnvm::NodeAttrs const&, std::1::vector<mxnet::NDArray*, std::1::allocator<mxnet::NDArray> > const&, std::__1::vector<mxnet::NDArray, std::1::allocator<mxnet::NDArray> > const&, mxnet::DispatchMode) + 8767 [bt] (2) 3 libmxnet.so 0x000000011497883c mxnet::Imperative::Invoke(mxnet::Context const&, nnvm::NodeAttrs const&, std::1::vector<mxnet::NDArray, std::__1::allocator<mxnet::NDArray> > const&, std::1::vector<mxnet::NDArray*, std::1::allocator<mxnet::NDArray> > const&) + 716 [bt] (3) 4 libmxnet.so 0x00000001148be48e SetNDInputsOutputs(nnvm::Op const, std::1::vector<mxnet::NDArray*, std::1::allocator<mxnet::NDArray> >, std::1::vector<mxnet::NDArray*, std::1::allocator<mxnet::NDArray> >, int, void const, int*, int, int, void***) + 1582 [bt] (4) 5 libmxnet.so 0x00000001148bf1d0 MXImperativeInvokeEx + 176 [bt] (5) 6 libffi.6.dylib 0x000000010b722884 ffi_call_unix64 + 76