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

Unclear error message in np.dstack #17267

Closed
eric-haibin-lin opened this issue Jan 10, 2020 · 1 comment · Fixed by #17271
Closed

Unclear error message in np.dstack #17267

eric-haibin-lin opened this issue Jan 10, 2020 · 1 comment · Fixed by #17271

Comments

@eric-haibin-lin
Copy link
Member

Description

mxnet.np.dstack throws dtype mismatch if one input is int32 and the other is float32. However, the error message is not that clear:

mxnet.base.MXNetError: [18:18:56] /generic-flavor/src/src/operator/nn/concat.cc:152: Check failed: i == dtype || i == -1: Non-uniform data type in Concat
Stack trace:
  /lib/libmxnet.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x24) [0x7f776418f5a4]
  /lib/libmxnet.so(+0x3523b10) [0x7f77664b4b10]
  /lib/libmxnet.so(mxnet::imperative::SetShapeType(mxnet::Context const&, nnvm::NodeAttrs const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&, mxnet::DispatchMode*)+0x46d) [0x7f776600f8ed]
  /lib/libmxnet.so(mxnet::Imperative::Invoke(mxnet::Context const&, nnvm::NodeAttrs const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&)+0x297) [0x7f7766005137]
  /lib/libmxnet.so(MXImperativeInvokeImpl(void*, int, void**, int*, void***, int, char const**, char const**)+0x5e5) [0x7f7765f11a05]
  /lib/libmxnet.so(MXImperativeInvokeEx+0x67) [0x7f7765f12d97]
  /python3.6/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(ffi_call_unix64+0x4c) [0x7f778ecbcef8]
  /python3.6/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(ffi_call+0x15f) [0x7f778ecbbfff]
  /python3.6/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(_ctypes_callproc+0x292) [0x7f778ecb3e02]

When this op is use in a nested gluon block, it's a bit hard to investigate what are the actual types of input 0 and input 1. It will be much more helpful if the actual data types can be printed.

litaotju added a commit to litaotju/incubator-mxnet that referenced this issue Jan 11, 2020
litaotju added a commit to litaotju/incubator-mxnet that referenced this issue Jan 11, 2020
@litaotju
Copy link
Contributor

@eric-haibin-lin ,
Got similar issue when trying to use the np.dstack api. I submit above PR for this. Please kindly help to review if you could. Thanks.

eric-haibin-lin pushed a commit that referenced this issue Jan 14, 2020
* Fix #17267, add expected and got datatype when non-uniform dtype fount in concat

* Add op name and input index to concat type error msg

* Fix lint error
litaotju added a commit to litaotju/incubator-mxnet that referenced this issue Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants