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

Concatenate with empty array fails. #17005

Closed
vjache opened this issue Dec 7, 2019 · 3 comments
Closed

Concatenate with empty array fails. #17005

vjache opened this issue Dec 7, 2019 · 3 comments
Labels

Comments

@vjache
Copy link

vjache commented Dec 7, 2019

Description

mx.__version__
'1.5.0'
a1 = md.array([ [1,2,3], [4,5,6] ]) # shape = (2, 3)
a2 = a1[0: 0] # shape = (0, 3)
md.concatenate([a1,a2])

Error Message

  File "<input>", line 1, in <module>
  File "C:\Users\vjache\AppData\Roaming\Python\Python37\site-packages\mxnet\ndarray\ndarray.py", line 3795, in concatenate
    ret[idx:idx+arr.shape[0]] = arr
  File "C:\Users\vjache\AppData\Roaming\Python\Python37\site-packages\mxnet\ndarray\ndarray.py", line 449, in __setitem__
    self._set_nd_basic_indexing(key, value)
  File "C:\Users\vjache\AppData\Roaming\Python\Python37\site-packages\mxnet\ndarray\ndarray.py", line 739, in _set_nd_basic_indexing
    shape[i], slice_i.step)
  File "C:\Users\vjache\AppData\Roaming\Python\Python37\site-packages\mxnet\ndarray\ndarray.py", line 2328, in _get_index_range
    raise IndexError('Slicing start %d exceeds limit of %d' % (start, length))
IndexError: Slicing start 2 exceeds limit of 2

To Reproduce

See description.

Steps to reproduce

See description.

What have you tried to solve it?

The second array is automatically computed by algorithm, and at some edge case it produce a zero lenghted slice.

Environment

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

C:\Users\vjache\miniconda3\envs\entropy\python.exe C:/Users/vjache/PycharmProjects/entropy/diagnose.py
----------Python Info----------
Version      : 3.7.4
Compiler     : MSC v.1915 64 bit (AMD64)
Build        : ('default', 'Aug  9 2019 18:34:13')
Arch         : ('64bit', 'WindowsPE')
------------Pip Info-----------
Version      : 19.3.1
Directory    : C:\Users\vjache\miniconda3\envs\entropy\lib\site-packages\pip
----------MXNet Info-----------
Version      : 1.5.0
Directory    : C:\Users\vjache\AppData\Roaming\Python\Python37\site-packages\mxnet
Num GPUs     : 1
Hashtag not found. Not installed from pre-built package.
----------System Info----------
Platform     : Windows-10-10.0.18362-SP0
system       : Windows
node         : DESKTOP-FKP41K9
release      : 10
version      : 10.0.18362
----------Hardware Info----------
machine      : AMD64
processor    : Intel64 Family 6 Model 142 Stepping 10, GenuineIntel
Name                                      
Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz  

----------Network Test----------
Setting timeout: 10
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0151 sec, LOAD: 0.7928 sec.
Timing for GluonNLP GitHub: https://github.com/dmlc/gluon-nlp, DNS: 0.0010 sec, LOAD: 0.7135 sec.
Timing for GluonNLP: http://gluon-nlp.mxnet.io, DNS: 0.1308 sec, LOAD: 0.2760 sec.
Timing for D2L: http://d2l.ai, DNS: 0.0823 sec, LOAD: 0.5318 sec.
Timing for D2L (zh-cn): http://zh.d2l.ai, DNS: 0.0420 sec, LOAD: 0.3652 sec.
Timing for FashionMNIST: https://repo.mxnet.io/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.1289 sec, LOAD: 1.0055 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.1225 sec, LOAD: 1.5063 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0546 sec, LOAD: 0.3528 sec.

Process finished with exit code 0

@vjache vjache added the Bug label Dec 7, 2019
@leezu
Copy link
Contributor

leezu commented Dec 7, 2019

You need to use numpy compatible mode. Zero dim arrays are not supported otherwise. See #14253

@leezu leezu closed this as completed Dec 7, 2019
@vjache
Copy link
Author

vjache commented Dec 7, 2019

Dear @leezu, I can't use the unexisting thing. I'm using Windows, and as you probably know it is not supported.
See also:
#15681 (comment) .

image

@leezu
Copy link
Contributor

leezu commented Dec 7, 2019

The page is outdated. Just install the normal nightly version or compile master version from source

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants