dmlc / minpy

NumPy interface with mixed backend execution
https://minpy.readthedocs.io/en/latest/
Other
1.11k stars 112 forks source link

argmax crashes mxnet #156

Closed wddabc closed 7 years ago

wddabc commented 7 years ago

Not sure it is related to my OS, I'm running on MacOS Sierra 10.12.3. Mxnet version:0.9.2

import minpy.numpy as np
a =np.array([0,1,2,3,4])
np.argmax(a)

Returns

[00:06:11] mxnet/dmlc-core/include/dmlc/./logging.h:300: [00:06:11] src/operator/tensor/./broadcast_reduce_op.h:228: Global reduction not supported yet

Stack trace returned 2 entries: [bt] (0) 0 libmxnet.so 0x000000010660cfb9 _ZN4dmlc15LogMessageFatalD1Ev + 41 [bt] (1) 1 libstdc++.6.dylib 0x0000000107992038 _ZTVSt15basic_stringbufIcSt11char_traitsIcESaIcEE + 16

Out[8]: [00:06:11] mxnet/dmlc-core/include/dmlc/./logging.h:300: [00:06:11] src/engine/./threaded_engine.h:357: [00:06:11] src/operator/tensor/./broadcast_reduce_op.h:228: Global reduction not supported yet

Stack trace returned 2 entries: [bt] (0) 0 libmxnet.so 0x000000010660cfb9 _ZN4dmlc15LogMessageFatalD1Ev + 41 [bt] (1) 1 libstdc++.6.dylib 0x0000000107992038 _ZTVSt15basic_stringbufIcSt11char_traitsIcESaIcEE + 16

An fatal error occurred in asynchronous engine operation. If you do not know what caused this error, you can try set environment variable MXNET_ENGINE_TYPE to NaiveEngine and run with debugger (i.e. gdb). This will force all operations to be synchronous and backtrace will give you the series of calls that lead to this error. Remember to set MXNET_ENGINE_TYPE back to empty after debugging.

Stack trace returned 2 entries: [bt] (0) 0 libmxnet.so 0x000000010660cfb9 _ZN4dmlc15LogMessageFatalD1Ev + 41 [bt] (1) 1 libstdc++.6.dylib 0x0000000107992038 _ZTVSt15basic_stringbufIcSt11char_traitsIcESaIcEE + 16

terminate called after throwing an instance of 'dmlc::Error' what(): [00:06:11] src/engine/./threaded_engine.h:357: [00:06:11] src/operator/tensor/./broadcast_reduce_op.h:228: Global reduction not supported yet

Stack trace returned 2 entries: [bt] (0) 0 libmxnet.so 0x000000010660cfb9 _ZN4dmlc15LogMessageFatalD1Ev + 41 [bt] (1) 1 libstdc++.6.dylib 0x0000000107992038 _ZTVSt15basic_stringbufIcSt11char_traitsIcESaIcEE + 16

An fatal error occurred in asynchronous engine operation. If you do not know what caused this error, you can try set environment variable MXNET_ENGINE_TYPE to NaiveEngine and run with debugger (i.e. gdb). This will force all operations to be synchronous and backtrace will give you the series of calls that lead to this error. Remember to set MXNET_ENGINE_TYPE back to empty after debugging.

Stack trace returned 2 entries: [bt] (0) 0 libmxnet.so 0x000000010660cfb9 _ZN4dmlc15LogMessageFatalD1Ev + 41 [bt] (1) 1 libstdc++.6.dylib 0x0000000107992038 _ZTVSt15basic_stringbufIcSt11char_traitsIcESaIcEE + 16

[1] 34192 abort ipython

Taco-W commented 7 years ago

This relates to the argmax implementation of MXNet. In short, axis as NULL is not supported yet.

The documentation of mxnet, http://mxnet.io/api/python/ndarray.html#mxnet.ndarray.argmax, says

axis (int or None, optional, default='None') – The axis along which to perform the reduction. Negative values means indexing from right to left. Requires axis to be set as int, because global reduction is not supported yet.