lebeg edited a comment on issue #15374: NightlyTestsForBinaries tutorials test 
broken
URL: 
https://github.com/apache/incubator-mxnet/issues/15374#issuecomment-505971155
 
 
   The test was broken by this PR [#15170: [MXNET-1413] Adding Large Tensor 
support for sort 
operators](https://github.com/apache/incubator-mxnet/pull/15170).
   The reason is that the default type of NDArray for `ArgSort` operator 
[changed](https://github.com/apache/incubator-mxnet/pull/15170/files#diff-067178695b7fe40b05ad18fa1a25c69dR91
   ) from `kFloat32` to `kInt64` or `kInt32`.
   ```cpp
   #if USE_INT64_TENSOR_SIZE == 1
       .set_default(mshadow::kInt64)
   #else
       .set_default(mshadow::kInt32)
   #endif
   ```
   This has caused a problem in [gluon-cv](https://github.com/dmlc/gluon-cv) in 
[`SSDMultiBoxLoss`](https://github.com/dmlc/gluon-cv/blob/c2296f87484b204db4c563987db819c768ae51c6/gluoncv/loss.py#L99)
 in particular at [this 
line](https://github.com/dmlc/gluon-cv/blob/c2296f87484b204db4c563987db819c768ae51c6/gluoncv/loss.py#L158)
   
   ```python
   rank = (cls_loss * (pos - 1)).argsort(axis=1).argsort(axis=1)
   hard_negative = rank < nd.maximum(self._min_hard_negatives, pos.sum(axis=1)
                                                 * 
self._negative_mining_ratio).expand_dims(-1)
   ```
   
   ```
   MXNetError: [20:54:33] 
/work/mxnet/3rdparty/mshadow/../../src/operator/tensor/../elemwise_op_common.h:135:
 Check failed: assign(&dattr, vec.at(i)): Incompatible attr in node  at 1-th 
input: expected int32, got float32
   Stack trace:
     [bt] (0) 
/work/mxnet/python/mxnet/../../lib/libmxnet.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x3c)
 [0x7f465e8070bc]
     [bt] (1) /work/mxnet/python/mxnet/../../lib/libmxnet.so(bool 
mxnet::op::ElemwiseAttr<int, &mxnet::op::type_is_none, &mxnet::op::type_assign, 
true, &mxnet::op::type_string[abi:cxx11], -1, -1>(nnvm::NodeAttrs const&, 
std::vector<int, std::allocator<int> >*, std::vector<int, std::allocator<int> 
>*, int const&)::{lambda(std::vector<int, std::allocator<int> > const&, 
unsigned long, char const*)#1}::operator()(std::vector<int, std::allocator<int> 
> const&, unsigned long, char const*) const+0x346) [0x7f465e953636]
     [bt] (2) /work/mxnet/python/mxnet/../../lib/libmxnet.so(bool 
mxnet::op::ElemwiseAttr<int, &mxnet::op::type_is_none, &mxnet::op::type_assign, 
true, &mxnet::op::type_string[abi:cxx11], -1, -1>(nnvm::NodeAttrs const&, 
std::vector<int, std::allocator<int> >*, std::vector<int, std::allocator<int> 
>*, int const&)+0x25d) [0x7f465e954a0d]
     [bt] (3) /work/mxnet/python/mxnet/../../lib/libmxnet.so(bool 
mxnet::op::ElemwiseType<2, 1>(nnvm::NodeAttrs const&, std::vector<int, 
std::allocator<int> >*, std::vector<int, std::allocator<int> >*)+0x34f) 
[0x7f465eb9bc5f]
     [bt] (4) 
/work/mxnet/python/mxnet/../../lib/libmxnet.so(std::_Function_handler<bool 
(nnvm::NodeAttrs const&, std::vector<int, std::allocator<int> >*, 
std::vector<int, std::allocator<int> >*), bool (*)(nnvm::NodeAttrs const&, 
std::vector<int, std::allocator<int> >*, std::vector<int, std::allocator<int> 
>*)>::_M_invoke(std::_Any_data const&, nnvm::NodeAttrs const&, std::vector<int, 
std::allocator<int> >*&&, std::vector<int, std::allocator<int> >*&&)+0x1d) 
[0x7f465e8adfcd]
     [bt] (5) 
/work/mxnet/python/mxnet/../../lib/libmxnet.so(mxnet::imperative::SetShapeType(mxnet::Context
 const&, nnvm::NodeAttrs const&, std::vector<mxnet::NDArray*, 
std::allocator<mxnet::NDArray*> > const&, std::vector<mxnet::NDArray*, 
std::allocator<mxnet::NDArray*> > const&, mxnet::DispatchMode*)+0x22d5) 
[0x7f4661792ba5]
     [bt] (6) 
/work/mxnet/python/mxnet/../../lib/libmxnet.so(mxnet::Imperative::Invoke(mxnet::Context
 const&, nnvm::NodeAttrs const&, std::vector<mxnet::NDArray*, 
std::allocator<mxnet::NDArray*> > const&, std::vector<mxnet::NDArray*, 
std::allocator<mxnet::NDArray*> > const&)+0x110) [0x7f466179e1b0]
     [bt] (7) 
/work/mxnet/python/mxnet/../../lib/libmxnet.so(MXImperativeInvokeImpl(void*, 
int, void**, int*, void***, int, char const**, char const**)+0x1c9) 
[0x7f466228acf9]
     [bt] (8) 
/work/mxnet/python/mxnet/../../lib/libmxnet.so(MXImperativeInvokeEx+0x8f) 
[0x7f466228b1ff]
   ```

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


With regards,
Apache Git Services

Reply via email to