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/04/27 10:44:52 UTC

[GitHub] [incubator-mxnet] FLSAlg opened a new issue #20223: gluon.data.vision.transforms.RandomRotation does not work when NumPy-array semantics is turned on

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


   ## Description
   if npx.set_np() sets numpy-array semantics  on then RandomRotation will not work
   
   ### Error Message
    File "C:\Users\.....\venv\lib\site-packages\mxnet\gluon\block.py", line 682, in __call__
       out = self.forward(*args)
     File "C:\Users\.......\venv\lib\site-packages\mxnet\gluon\data\vision\transforms.py", line 269, in forward
       raise TypeError("This transformation only supports float32. "
   TypeError: This transformation only supports float32. Consider calling it after ToTensor
   
   ## To Reproduce
               from mxnet import npx
               npx.set_np()   # without this (or with npx.reset_np()) there is no problem
   
               img = mx.image.imread("image.png")
               img_t = transforms.ToTensor()(img)
               rotation = transforms.RandomRotation((5, 6), True, False)  
               img_rt = rotation(img_t)  # this generates the error
   
   ### Steps to reproduce
   1. Run the code snippet above
   
   
   ## What have you tried to solve it?
   I suspect there are more transforms with this problem - dont have time to search and catalog all appearnces.
   My work around is to deactivate np semantics with  npx.reset_np() before calling functions from transforms and then reactivate with npx.set_np() afterwards (the problem appears in a large project)
   
   ## Environment
   mxnet 1.7.0.post2
   
   


-- 
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] github-actions[bot] commented on issue #20223: gluon.data.vision.transforms.RandomRotation does not work when NumPy-array semantics is turned on

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #20223:
URL: https://github.com/apache/incubator-mxnet/issues/20223#issuecomment-827507458


   Welcome to Apache MXNet (incubating)! We are on a mission to democratize AI, and we are glad that you are contributing to it by opening this issue.
   Please make sure to include all the relevant context, and one of the @apache/mxnet-committers will be here shortly.
   If you are interested in contributing to our project, let us know! Also, be sure to check out our guide on [contributing to MXNet](https://mxnet.apache.org/community/contribute) and our [development guides wiki](https://cwiki.apache.org/confluence/display/MXNET/Developments).


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