aidan-plenert-macdonald commented on issue #9118: argmax causes python VM to 
crash
URL: 
https://github.com/apache/incubator-mxnet/issues/9118#issuecomment-352522212
 
 
   Reproducable in version 0.11.1b20170929),
   ```
   $ pip list | grep mxnet
   mxnet (0.11.1b20170929)
   $ python
   Python 3.6.3 (default, Oct  4 2017, 06:09:15) 
   [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
   Type "help", "copyright", "credits" or "license" for more information.
   >>> from mxnet import nd
   >>> A=nd.array([0,1,2])
   >>> nd.argmax(A)
   [10:40:37] 
/Users/travis/build/dmlc/mxnet-distro/mxnet-build/dmlc-core/include/dmlc/logging.h:308:
 [10:40:37] src/operator/tensor/./broadcast_reduce_op.h:352: Global reduction 
not supported yet
   
   Stack trace returned 10 entries:
   [bt] (0) 0   libmxnet.so                         0x000000010d0f7408 
_ZN4dmlc15LogMessageFatalD2Ev + 40
   [bt] (1) 1   libmxnet.so                         0x000000010d0f4fc9 
_ZN4dmlc15LogMessageFatalD1Ev + 9
   [bt] (2) 2   libmxnet.so 
   ```
   
   And in version 1.0.0.post1,
   ```
   $ pip list | grep mxnet
   mxnet (1.0.0.post1)
   $ python
   Python 3.6.3 (default, Oct  4 2017, 06:09:15) 
   [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
   Type "help", "copyright", "credits" or "license" for more information.
   >>> from mxnet import nd
   >>> A=nd.array([0,1,2])
   >>> nd.argmax(A)
   [10:45:02] 
/Users/travis/build/dmlc/mxnet-distro/mxnet-build/dmlc-core/include/dmlc/logging.h:308:
 [10:45:02] src/operator/tensor/./broadcast_reduce_op.h:396: Global reduction 
not supported yet
   
   Stack trace returned 10 entries:
   [bt] (0) 0   libmxnet.so                         0x0000000105b40898 
_ZN4dmlc15LogMessageFatalD2Ev + 40
   [bt] (1) 1   libmxnet.so                         0x0000000105b3e599 
_ZN4dmlc15LogMessageFatalD1Ev + 9
   [bt] (2) 2   libmxnet.so
   ```
   
   Looking at the specified line of code 
[broadcast_reduce_op.h:396](https://github.com/apache/incubator-mxnet/blob/master/src/operator/tensor/broadcast_reduce_op.h#L396),
   ```c++
     if (!param.axis) LOG(FATAL) << "Global reduction not supported yet";
   ```
   
   It hints that including axis works, which is a pretty stupid error.
   ```
   $ python
   Python 3.6.3 (default, Oct  4 2017, 06:09:15) 
   [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
   Type "help", "copyright", "credits" or "license" for more information.
   >>> from mxnet import nd
   >>> A=nd.array([0,1,2])
   >>> nd.argmax(A, axis=0)
   
   [ 2.]
   <NDArray 1 @cpu(0)>
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to