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 2018/12/09 13:25:15 UTC

[GitHub] sbodenstein opened a new issue #13592: Transpose with MXNET_BACKWARD_DO_MIRROR throws exception

sbodenstein opened a new issue #13592: Transpose with MXNET_BACKWARD_DO_MIRROR throws exception
URL: https://github.com/apache/incubator-mxnet/issues/13592
 
 
   Consider the following (using MXNet release version 1.3.1 on OSX):
   ```
   import mxnet as mx
   import os
   
   def f():
       shape = (1,2,3,4)
       sym = mx.sym.Variable('data', shape=shape)
       sym = mx.sym.transpose(sym, axes=(0,3,1,2))
       sym = mx.sym.transpose(sym, axes=(0,2,3,1))
       exe = sym.simple_bind(ctx=mx.cpu())
       output = exe.forward()[0]
       exe.backward(output)
       return exe.grad_arrays[0].asnumpy()
   
   f()
   ```
   returns an array. However:
   ```
   os.environ["MXNET_BACKWARD_DO_MIRROR"] = "1"
   f()
   ```
   throws an exception:
   ```
   Traceback (most recent call last):
     File "/Users/sebastianb/Documents/Wolfram_work/2018_October/test_mx.py", line 20, in <module>
       print(f())
     File "/Users/sebastianb/Documents/Wolfram_work/2018_October/test_mx.py", line 16, in f
       return exe.grad_arrays[0].asnumpy()
     File "/Users/sebastianb/git/mxnet_seb/python/mxnet/ndarray/ndarray.py", line 1980, in asnumpy
       ctypes.c_size_t(data.size)))
     File "/Users/sebastianb/git/mxnet_seb/python/mxnet/base.py", line 252, in check_call
       raise MXNetError(py_str(_LIB.MXGetLastError()))
   mxnet.base.MXNetError: [15:20:11] src/operator/tensor/./matrix_op-inl.h:310: Check failed: req[0] == kWriteTo (0 vs. 1) Transpose does not support inplace
   
   Stack trace returned 10 entries:
   [bt] (0) 0   libmxnet.so                         0x0000000118e327f5 dmlc::StackTrace() + 261
   [bt] (1) 1   libmxnet.so                         0x0000000118e325af dmlc::LogMessageFatal::~LogMessageFatal() + 47
   [bt] (2) 2   libmxnet.so                         0x000000011a1598d1 void mxnet::op::Transpose<mshadow::cpu>(nnvm::NodeAttrs const&, mxnet::OpContext const&, std::__1::vector<mxnet::TBlob, std::__1::allocator<mxnet::TBlob> > const&, std::__1::vector<mxnet::OpReqType, std::__1::allocator<mxnet::OpReqType> > const&, std::__1::vector<mxnet::TBlob, std::__1::allocator<mxnet::TBlob> > const&) + 257
   [bt] (3) 3   libmxnet.so                         0x000000011a3c8227 mxnet::exec::FComputeExecutor::Run(mxnet::RunContext, bool) + 87
   [bt] (4) 4   libmxnet.so                         0x000000011a3f54a4 std::__1::__function::__func<mxnet::exec::GraphExecutor::CreateCachedSegOpr(unsigned long, unsigned long)::$_7, std::__1::allocator<mxnet::exec::GraphExecutor::CreateCachedSegOpr(unsigned long, unsigned long)::$_7>, void (mxnet::RunContext, mxnet::engine::CallbackOnComplete)>::operator()(mxnet::RunContext&&, mxnet::engine::CallbackOnComplete&&) + 84
   [bt] (5) 5   libmxnet.so                         0x000000011a3b4da5 mxnet::engine::ThreadedEngine::ExecuteOprBlock(mxnet::RunContext, mxnet::engine::OprBlock*) + 533
   [bt] (6) 6   libmxnet.so                         0x000000011a3b8c71 void std::__1::__invoke_void_return_wrapper<void>::__call<mxnet::engine::ThreadedEnginePerDevice::PushToExecute(mxnet::engine::OprBlock*, bool)::'lambda'()::operator()() const::'lambda'(std::__1::shared_ptr<dmlc::ManualEvent>)&, std::__1::shared_ptr<dmlc::ManualEvent> >(mxnet::engine::ThreadedEnginePerDevice::PushToExecute(mxnet::engine::OprBlock*, bool)::'lambda'()::operator()() const::'lambda'(std::__1::shared_ptr<dmlc::ManualEvent>)&&&, std::__1::shared_ptr<dmlc::ManualEvent>&&) + 145
   [bt] (7) 7   libmxnet.so                         0x000000011a3b5de3 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::function<void (std::__1::shared_ptr<dmlc::ManualEvent>)>, std::__1::shared_ptr<dmlc::ManualEvent> > >(void*) + 83
   [bt] (8) 8   libsystem_pthread.dylib             0x00007fff59f13661 _pthread_body + 340
   [bt] (9) 9   libsystem_pthread.dylib             0x00007fff59f1350d _pthread_body + 0
   ``` 
   It may be related to issue #8048.

----------------------------------------------------------------
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