You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/08/21 09:15:10 UTC

[GitHub] tornadomeet opened a new issue #7536: mx.sym.L2Normalization has bug when shpae[0] is bigger than 65536 and multi-gpus

tornadomeet opened a new issue #7536: mx.sym.L2Normalization has bug when shpae[0] is bigger than 65536 and multi-gpus
URL: https://github.com/apache/incubator-mxnet/issues/7536
 
 
   when first shape of L2Normalization data > 65536, then it will give errors like this:
   ![image](https://user-images.githubusercontent.com/5860892/29511992-8adeac5a-8693-11e7-84af-683809a84b26.png)
   
   we can reproduce as follows:  
   * change code form https://github.com/apache/incubator-mxnet/blob/master/example/image-classification/symbols/mlp.py to:
   * run mxnet `train_mnist.py` examples from: https://github.com/apache/incubator-mxnet/blob/master/example/image-classification/train_mnist.py  
   * change line form https://github.com/apache/incubator-mxnet/blob/master/example/image-classification/train_mnist.py#L81 to ```gpus="0,1",```
   
   
   ```python
   """
   a simple multilayer perceptron
   """
   import mxnet as mx
   
   def get_symbol(num_classes=10, **kwargs):
       fc2_num_hidden = 70000
       data = mx.symbol.Variable('data')
       data = mx.sym.Flatten(data=data)
       fc1  = mx.symbol.FullyConnected(data = data, name='fc1', num_hidden=128)
       act1 = mx.symbol.Activation(data = fc1, name='relu1', act_type="relu")
       fc2_weight = mx.sym.Variable("fc2_weight", shape=(fc2_num_hidden, 128),
                                    init=mx.init.Xavier(rnd_type='gaussian', factor_type="in", magnitude=2))
       fc2_norm_weight = mx.symbol.L2Normalization(data=fc2_weight, mode="instance", name="fc2_norm_weight")
       fc2  = mx.symbol.FullyConnected(data = act1, weight = fc2_norm_weight, name = 'fc2', num_hidden = fc2_num_hidden)
       act2 = mx.symbol.Activation(data = fc2, name='relu2', act_type="relu")
       fc3  = mx.symbol.FullyConnected(data = act2, name='fc3', num_hidden=num_classes)
       mlp  = mx.symbol.SoftmaxOutput(data = fc3, name = 'softmax')
       return mlp
   ```
   
   then, when running with multi-gpus, training is ok, but when trained when more than one gpu, it will broken.
   @sxjscience @piiswrong  thanks.
 
----------------------------------------------------------------
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