You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/02/14 23:51:53 UTC

[GitHub] vandanavk commented on issue #7853: ndarray.choose_element_0index not differentiable / bug in gradients after slicing?

vandanavk commented on issue #7853: ndarray.choose_element_0index not differentiable / bug in gradients after slicing?
URL: https://github.com/apache/incubator-mxnet/issues/7853#issuecomment-463850347
 
 
   Error on MXNet v1.5 (built from source). Tested on OSX
   ```
   ---------------------------------------------------------------------------
   MXNetError                                Traceback (most recent call last)
   <ipython-input-13-b04ee09a6160> in <module>()
        12      element = nd.choose_element_0index(w.data(), nd.array([0]))
        13      y = nd.square(element)
   ---> 14      y.backward()
   
   ~/Documents/mxnet/incubator-mxnet/python/mxnet/ndarray/ndarray.py in backward(self, out_grad, retain_graph, train_mode)
      2213             ctypes.c_int(train_mode),
      2214             ctypes.c_void_p(0),
   -> 2215             ctypes.c_void_p(0)))
      2216 
      2217     def tostype(self, stype):
   
   ~/Documents/mxnet/incubator-mxnet/python/mxnet/base.py in check_call(ret)
       250     """
       251     if ret != 0:
   --> 252         raise MXNetError(py_str(_LIB.MXGetLastError()))
       253 
       254 
   
   MXNetError: [15:24:46] src/pass/gradient.cc:192: Operator choose_element_0index is non-differentiable because it didn't register FGradient attribute.
   
   Stack trace returned 10 entries:
   [bt] (0) 0   libmxnet.so                         0x000000011232dbd6 dmlc::StackTrace() + 1238
   [bt] (1) 1   libmxnet.so                         0x000000011232d5c5 dmlc::LogMessageFatal::~LogMessageFatal() + 53
   [bt] (2) 2   libmxnet.so                         0x00000001162009ea nnvm::pass::(anonymous namespace)::Gradient(nnvm::Graph) + 13066
   [bt] (3) 3   libmxnet.so                         0x00000001156de032 nnvm::Graph std::__1::__invoke_void_return_wrapper<nnvm::Graph>::__call<nnvm::Graph (*&)(nnvm::Graph), nnvm::Graph>(nnvm::Graph (*&&&)(nnvm::Graph), nnvm::Graph&&) + 162
   [bt] (4) 4   libmxnet.so                         0x00000001156dded0 std::__1::__function::__func<nnvm::Graph (*)(nnvm::Graph), std::__1::allocator<nnvm::Graph (*)(nnvm::Graph)>, nnvm::Graph (nnvm::Graph)>::operator()(nnvm::Graph&&) + 64
   [bt] (5) 5   libmxnet.so                         0x00000001161e5e18 nnvm::ApplyPasses(nnvm::Graph, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) + 1448
   [bt] (6) 6   libmxnet.so                         0x000000011512548e nnvm::ApplyPass(nnvm::Graph, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 590
   [bt] (7) 7   libmxnet.so                         0x00000001152376fc nnvm::pass::Gradient(nnvm::Graph, std::__1::vector<nnvm::NodeEntry, std::__1::allocator<nnvm::NodeEntry> >, std::__1::vector<nnvm::NodeEntry, std::__1::allocator<nnvm::NodeEntry> >, std::__1::vector<nnvm::NodeEntry, std::__1::allocator<nnvm::NodeEntry> >, std::__1::function<nnvm::NodeEntry (std::__1::vector<nnvm::NodeEntry, std::__1::allocator<nnvm::NodeEntry> >&&)>, std::__1::function<int (nnvm::Node const&)>, std::__1::function<nnvm::NodeEntry (nnvm::NodeEntry const&, nnvm::NodeEntry const&)>, std::__1::vector<nnvm::Op const*, std::__1::allocator<nnvm::Op const*> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) + 8764
   [bt] (8) 8   libmxnet.so                         0x000000011537a8c5 mxnet::Imperative::Backward(std::__1::vector<mxnet::NDArray*, std::__1::allocator<mxnet::NDArray*> > const&, std::__1::vector<mxnet::NDArray*, std::__1::allocator<mxnet::NDArray*> > const&, std::__1::vector<mxnet::NDArray*, std::__1::allocator<mxnet::NDArray*> > const&, bool, bool, bool) + 13445
   [bt] (9) 9   libmxnet.so                         0x00000001150d434d MXAutogradBackwardEx + 3293
   ```
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services