You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mxnet.apache.org by GitBox <gi...@apache.org> on 2021/02/05 20:43:55 UTC

[GitHub] [incubator-mxnet] DNXie opened a new issue #19852: `mxnet.gluon.nn.instancenorm` output NaN

DNXie opened a new issue #19852:
URL: https://github.com/apache/incubator-mxnet/issues/19852


   ## Description
   `mxnet.gluon.nn.instancenorm` output NaN 
   
   
   ## To Reproduce
   ~~~python
   import mxnet
   layer=mxnet.gluon.nn.InstanceNorm()
   layer.initialize()
   input=mxnet.nd.array([[[[ 1.4918449e+38],[ 9.0072335e+37],[-1.3146734e+38],[ 3.0568930e+38]]]])
   out=layer(input)
   print(out)
   ~~~
   
   Output:
   ~~~python
   [[[[nan]
      [nan]
      [nan]
      [nan]]]]
   <NDArray 1x1x4x1 @cpu(0)>
   ~~~
   
   
   ## Environment
   
   OS: ubuntu 18.04
   Python: 3.7.6
   pip: 20.0.2
   numpy: 1.18.5
   mxnet: 1.6.0
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org


[GitHub] [incubator-mxnet] TristonC commented on issue #19852: `mxnet.gluon.nn.instancenorm` output NaN

Posted by GitBox <gi...@apache.org>.
TristonC commented on issue #19852:
URL: https://github.com/apache/incubator-mxnet/issues/19852#issuecomment-774373100


   @DNXie It runs into numerical overflow for your case as entries in your ndarry are 'big' in terms of float32 representation. You may need to perform mathematical treatment for the input before doing the InstanceNorm, such as dividing every element by its max entry.  


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org