-
DescriptionCalling nd.random.uniform() with a improper shape spec causes a hard exception and python exit. Environment info
Running from Python 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:07:31) Build info (Required if built from source)Did not build from source - using version that came with Conda. Error Message:Floating exception Minimum reproducible example
What have you tried to solve it?Looked through source code - it looks like the call goes from master/python/mxnet/ndarray/random.py either to some internal C call. Or, it might go to the master/python/mxnet/ndarray/numpy/random.py code for uniform() - which does not check for this case (lines 123-132). |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
Hey, this is the MXNet Label Bot. |
Beta Was this translation helpful? Give feedback.
-
@michaelkr Thanks for reporting this issue. Is that reproducible on MXNet 1.5? Apart from that, could you please provide the shape you tested? |
Beta Was this translation helpful? Give feedback.
-
@lanking520 I will try to get mxnet 1.5 installed with conda on another machine and test. The exact calling sequence to duplicate is: start python, then:
which exits python with a "Floating exception" that cannot be caught. |
Beta Was this translation helpful? Give feedback.
-
@michaelkr
|
Beta Was this translation helpful? Give feedback.
-
Thanks @xidulu ...it was actually a typo in my code, so I don't need the workaround. I submitted it here because I felt it should result in a catchable exception or similar behavior, not a crash. |
Beta Was this translation helpful? Give feedback.
-
@michaelkr
I could not find out a way to reproduce the floating number exception (which should behave like core dump) you mentioned so far. |
Beta Was this translation helpful? Give feedback.
-
@xidulu Thanks for testing - I see that on my MacOS machine, running mxnet 1.5, I get the same result as you - a catchable exception. But on my CentOS 7.5 machine, again with mxnet 1.5, it just core dumps. |
Beta Was this translation helpful? Give feedback.
-
@michaelkr
|
Beta Was this translation helpful? Give feedback.
@michaelkr
What you are trying to create is something called "Zero-size tensor", which, as far as I'm concerned, is not supported by
mx.ndarray
, as the zero in the shape means unknown rather than a concrete number, see bullet 2 in #14253 for more details.However, the deep numpy API supports zero-size tensor, I'm not sure if the version installed using pip includes this feature, but if you build the latets version of mxnet from source, you could call the api like this: