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

Floating Point Exception mxnet.ndarray.contrib.bipartite_matching #18927

Closed
leeyeetonn opened this issue Aug 14, 2020 · 2 comments · Fixed by #18972
Closed

Floating Point Exception mxnet.ndarray.contrib.bipartite_matching #18927

leeyeetonn opened this issue Aug 14, 2020 · 2 comments · Fixed by #18972

Comments

@leeyeetonn
Copy link

Description

(A clear and concise description of what the bug is.)

  • mxnet.ndarray.contrib.bipartite_matching gives floating point exception when input data's shape contains 0.
  • Curiously, it only gives floating point exception when 0 is at certain location in shape, and gives dmlc::Error for other locations. See the provided code snippets for example.

Error Message

(Paste the complete error message. Please also include stack trace by setting environment variable DMLC_LOG_STACK_TRACE_DEPTH=10 before running your script.)

Floating point exception(core dumped)

To Reproduce

(If you developed your own code, please provide a short script that reproduces the error. For existing examples, please provide link.)
The code below produces floating point exception:

import mxnet as mx
import numpy as np

input = mx.nd.array(np.random.rand(0,2))
mx.ndarray.contrib.bipartite_matching(input, threshold=0.1)

gives:

Floating point exception (core dumped)

If swap the position of the 0 in shape, it gives dmlc::Error instead:

import mxnet as mx
import numpy as np

input = mx.nd.array(np.random.rand(2,0))
mx.ndarray.contrib.bipartite_matching(input, threshold=0.1)

gives:

terminate called after throwing an instance of 'dmlc::Error'
what(): [22:15:23] src/imperative/./imperative_utils.h:146: Operator _contrib_bipartite_matching inferring shapes failed.
input shapes:
[2,-1]
output shapes:
[2]
[-1]
operator attributes:
threshold : 0.1
Stack trace:
[bt] (0) /root/miniconda3/lib/python3.7/site-packages/mxnet/libmxnet.so(+0x307d3b) [0x7f5828e96d3b]
[bt] (1) /root/miniconda3/lib/python3.7/site-packages/mxnet/libmxnet.so(mxnet::imperative::SetShapeType(mxnet::Context const&, nnvm::NodeAttrs const&, std::vector<mxnet::NDArray*, std::allocatormxnet::NDArray* > const&, std::vector<mxnet::NDArray*, std::allocatormxnet::NDArray* > const&, mxnet::DispatchMode*)+0x363b) [0x7f582c0323bb]
Aborted (core dumped)

Steps to reproduce

(Paste the commands you ran that produced the error.)

  1. run the above code snippets in python Interpreter or run it as a python script

What have you tried to solve it?

Environment

We recommend using our script for collecting the diagnositc information. Run the following command and paste the outputs below:

curl --retry 10 -s https://raw.githubusercontent.com/dmlc/gluon-nlp/master/tools/diagnose.py | python

# paste outputs here

I got 404 when trying to get the script.

Some environment information:

  • OS: ubuntu 18.04
  • Python: 3.7.6
  • pip: 20.0.2
  • numpy: 1.18.5
  • mxnet: 1.6.0
@github-actions
Copy link

Welcome to Apache MXNet (incubating)! We are on a mission to democratize AI, and we are glad that you are contributing to it by opening this issue.
Please make sure to include all the relevant context, and one of the @apache/mxnet-committers will be here shortly.
If you are interested in contributing to our project, let us know! Also, be sure to check out our guide on contributing to MXNet and our development guides wiki.

szha added a commit to szha/mxnet that referenced this issue Aug 20, 2020
@szha szha mentioned this issue Aug 20, 2020
5 tasks
@szha
Copy link
Member

szha commented Aug 20, 2020

See the above PR for the fix.

szha added a commit that referenced this issue Aug 21, 2020
* fix #18927

* fix lint
chinakook pushed a commit to chinakook/mxnet that referenced this issue Nov 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