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 2017/12/17 10:13:21 UTC

[GitHub] KnightOfTheMoonlight opened a new issue #9110: 3D dilation support

KnightOfTheMoonlight opened a new issue #9110: 3D dilation support
URL: https://github.com/apache/incubator-mxnet/issues/9110
 
 
   From mxnet api, 3d dilation is supported. However, When I check this, I find in fact, 3d dilation may not be included in mxnet.
   
   Ubuntu 16.04
   mxnet 1.0.0
   python
   
   ##Error Message:
   Dilate is not supported in 3d convolution
   `---------------------------------------------------------------------------
   RuntimeError                              Traceback (most recent call last)
   <ipython-input-3-24074751f6c9> in <module>()
        11 # conv3D_ex = conv3D.simple_bind(mx.gpu(), arg_dicts={'data':data})
        12 # conv3D_exe = conv3D_bn.simple_bind(mx.gpu(), data=data.shape)
   ---> 13 conv3D_exe = conv3D_maxpl.simple_bind(mx.gpu(), data=data.shape)
        14 args = conv3D_exe.arg_dict
        15 
   
   /home/li216/Research/code/mxnet/python/mxnet/symbol.pyc in simple_bind(self, ctx, grad_req, type_dict, group2ctx, shared_arg_names, shared_exec, shared_buffer, **kwargs)
      1477                 error_msg += "%s: %s\n" % (k, v)
      1478             error_msg += "%s" % e
   -> 1479             raise RuntimeError(error_msg)
      1480 
      1481         # update shared_buffer
   
   RuntimeError: simple_bind error. Arguments:
   data: (3L, 1L, 7L, 7L, 7L)
   Error in operator convolution3: [20:54:34] src/operator/./convolution-inl.h:495: Check failed: param_.dilate.Size() == 1U (8 vs. 1) Dilate is not supported in 3d convolution
   
   Stack trace returned 10 entries:
   [bt] (0) /home/li216/Research/code/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN4dmlc15LogMessageFatalD1Ev+0x3c) [0x7f9e0723ccfc]
   [bt] (1) /home/li216/Research/code/mxnet/python/mxnet/../../lib/libmxnet.so(_ZNK5mxnet2op15ConvolutionProp10InferShapeEPSt6vectorIN4nnvm6TShapeESaIS4_EES7_S7_+0x2c9a) [0x7f9e0814e9fa]
   [bt] (2) /home/li216/Research/code/mxnet/python/mxnet/../../lib/libmxnet.so(+0x131b46a) [0x7f9e07e9246a]
   [bt] (3) /home/li216/Research/code/mxnet/python/mxnet/../../lib/libmxnet.so(+0x274bc23) [0x7f9e092c2c23]
   [bt] (4) /home/li216/Research/code/mxnet/python/mxnet/../../lib/libmxnet.so(+0x274cfda) [0x7f9e092c3fda]
   [bt] (5) /home/li216/Research/code/mxnet/python/mxnet/../../lib/libmxnet.so(+0x274dfc6) [0x7f9e092c4fc6]
   [bt] (6) /home/li216/Research/code/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN4nnvm11ApplyPassesENS_5GraphERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE+0x32c) [0x7f9e092ebb2c]
   [bt] (7) /home/li216/Research/code/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN4nnvm9ApplyPassENS_5GraphERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x3c9) [0x7f9e082859c9]
   [bt] (8) /home/li216/Research/code/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN4nnvm4pass10InferShapeENS_5GraphESt6vectorINS_6TShapeESaIS3_EENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x1f3) [0x7f9e08289373]
   [bt] (9) /home/li216/Research/code/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet4exec13GraphExecutor4InitEN4nnvm6SymbolERKNS_7ContextERKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_St4lessISD_ESaISt4pairIKSD_S4_EEERKSt6vectorIS4_SaIS4_EESR_SR_RKSt13unordered_mapISD_NS2_6TShapeESt4hashISD_ESt8equal_toISD_ESaISG_ISH_ST_EEERKSS_ISD_iSV_SX_SaISG_ISH_iEEERKSN_INS_9OpReqTypeESaIS18_EERKSt13unordered_setISD_SV_SX_SaISD_EEPSN_INS_7NDArrayESaIS1I_EES1L_S1L_PSS_ISD_S1I_SV_SX_SaISG_ISH_S1I_EEEPNS_8ExecutorERKSS_INS2_9NodeEntryES1I_NS2_13NodeEntryHashENS2_14NodeEntryEqualESaISG_IKS1S_S1I_EEE+0x612) [0x7f9e082df082]
   
   `
   ## Minimum reproducible example
   `# 3d convolution 
   import mxnet as mx
   data = mx.nd.arange(1029).reshape((3,1,7,7,7)) # NCDHW
   
   x = mx.sym.Variable('data', shape=(3,1,7,7,7))
   conv3D = mx.sym.Convolution(data=x, kernel=(3, 3, 3), pad=(2, 2, 2), dilate=(2, 2, 2), num_filter=2)`
   
   ## What have you tried to solve it?
   I tried to check the source code of `src/operator/convolution-inl.h`. And I  found all these code related to dilation.
   format:
       line number code snapshot 
   `DMLC_DECLARE_PARAMETER
   69    DMLC_DECLARE_FIELD(dilate).set_default(TShape())
   70    .describe("convolution dilate: (h, w) or (d, h, w)");
   
   Forward function
   133 if (param_.kernel.ndim() > 2) {
         LOG(FATAL) << "Volume convolution is not implmented in mshadow";
       }
   # seems only support 2d dilation
   177           param_.dilate[0],
   178           param_.dilate[1]);
   
   Backward function
   212 if (param_.kernel.ndim() > 2) {
         LOG(FATAL) << "Volume convolution is not implmented in mshadow";
       }
   # seems only support 2d dilation
   266           param_.dilate[0],
   267           param_.dilate[1]);
   
   479     CHECK_EQ(param_.dilate.Size(), 1U)
           << "Dilate is not supported in 3d convolution";
   
   InferShape function
   448    } else if (param_.kernel.ndim() == 3) {
   449      // 3d conv_v1
   
   init function
   385      CHECK_EQ(param_.kernel.ndim(), 3U) << param_.kernel.ndim() << "D convolution not supported";
   386      param_.layout = param_.layout ? param_.layout.value(): mshadow::kNCDHW;
   387      if (param_.stride.ndim() == 0) param_.stride = Shape3(1, 1, 1);
   388      if (param_.dilate.ndim() == 0) param_.dilate = Shape3(1, 1, 1);
   389      if (param_.pad.ndim() == 0) param_.pad = Shape3(0, 0, 0);
   `
   As you can see, this code is not consistent. Some parts says 3d dilation supported other parts not.

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