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/11/06 02:54:14 UTC

[GitHub] yuantangliang opened a new issue #8557: Convolution dilate run not as expected in cpu context

yuantangliang opened a new issue #8557: Convolution  dilate run not as expected  in  cpu context
URL: https://github.com/apache/incubator-mxnet/issues/8557
 
 
   Note: Providing complete information in the most concise form is the best way to get help. This issue template serves as the checklist for essential information to most of the technical issues.
   
   
   If the issue is non-technical, feel free to present the information in what you believe is the best form.
   
   ## Description
   (Brief description of the problem in no more than 2 sentences.)
   
   ## Environment info (Required)
   
   ```
   What to do:
   1. Download the diagnosis script from https://raw.githubusercontent.com/apache/incubator-mxnet/master/tools/diagnose.py
   2. Run the script using `python diagnose.py` and paste its output here.
   
   ```
   
   Package used (Python/R/Scala/Julia):
   (I'm using ...)
   
   For Scala user, please provide:
   1. Java version: (`java -version`)
   2. Maven version: (`mvn -version`)
   3. Scala runtime if applicable: (`scala -version`)
   
   For R user, please provide R `sessionInfo()`:
   
   ## Build info (Required if built from source)
   
   Compiler (gcc/clang/mingw/visual studio):
   
   MXNet commit hash:
   (Paste the output of `git rev-parse HEAD` here.)
   
   Build config:
   (Paste the content of config.mk, or the build command.)
   
   ## Error Message:
   (Paste the complete error message, including stack trace.)
   
   ## Minimum reproducible example
   (If you are using your own code, please provide a short script that reproduces the error. Otherwise, please provide link to the existing example.)
   
   ## Steps to reproduce
   (Paste the commands you ran that produced the error.)
   
   '''
   import numpy as np
   import mxnet as mx
   
   
   def test_dilate_cpu():
       input_data = mx.symbol.Variable(name="data")
       ctx = mx.cpu(0)
   
       e = mx.symbol.Convolution(data=input_data, kernel =(3,1),pad=(2,0),dilate =(2,1), num_filter = 1,num_group=1,name="uo",no_bias=True)
       e = mx.sym.MakeLoss(e)
   
       data = np.arange(0,60)
       data = data.reshape([1, 1, 30, 2])
       # print data
       data = mx.nd.array(data,ctx=ctx)
       weight_value = np.array([1, 1, 1])
       weight_value = weight_value.reshape([1, 1,3, 1])
       weight_value = mx.nd.array(weight_value,ctx=ctx)
       out_grad = mx.nd.array(np.zeros(data.shape),ctx=ctx)
       exe1 = e.bind(ctx, {"data": data,'uo_weight':weight_value},args_grad=[out_grad,weight_value])
   
       y = exe1.forward(is_train=True)
       exe1.backward()
       print  'code in cpu',y[0].asnumpy()
   
   
   def test_dilate_gpu():
       input_data = mx.symbol.Variable(name="data")
       ctx = mx.cpu(0)
   
       e = mx.symbol.Convolution(data=input_data, kernel =(3,1),pad=(2,0),dilate =(2,1), num_filter = 1,num_group=1,name="uo",no_bias=True)
       e = mx.sym.MakeLoss(e)
   
       data = np.arange(0,60)
       data = data.reshape([1, 1, 30, 2])
       # print data
       data = mx.nd.array(data,ctx=ctx)
       weight_value = np.array([1, 1, 1])
       weight_value = weight_value.reshape([1, 1,3, 1])
       weight_value = mx.nd.array(weight_value,ctx=ctx)
       out_grad = mx.nd.array(np.zeros(data.shape),ctx=ctx)
       exe1 = e.bind(ctx, {"data": data,'uo_weight':weight_value},args_grad=[out_grad,weight_value])
   
       y = exe1.forward(is_train=True)
       exe1.backward()
       print "code in gpu", y[0].asnumpy()
   
   
   test_dilate_cpu()
   test_dilate_gpu()
   '''
   
   ## What have you tried to solve it?
   
   1.
   2.
   

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